mirror of
https://github.com/Yonle/bostr.git
synced 2025-03-17 13:22:49 +01:00
fix dockerfile and use external config.js
This commit is contained in:
parent
52d92de8fa
commit
685e80e639
@ -19,9 +19,9 @@ WORKDIR /usr/src/app
|
||||
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
|
||||
# into this layer.
|
||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
||||
--mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
# --mount=type=bind,source=package-lock.json,target=package-lock.json \
|
||||
--mount=type=cache,target=/root/.npm \
|
||||
npm ci --omit=dev
|
||||
npm i --omit=dev
|
||||
|
||||
# Run the application as a non-root user.
|
||||
USER node
|
||||
|
@ -48,10 +48,8 @@ tmux new -d "node index.js"
|
||||
```
|
||||
git clone https://github.com/mroxso/bostr
|
||||
cd bostr
|
||||
npm i
|
||||
cp config.js.example config.js
|
||||
docker build -t bostr:local
|
||||
docker run --rm --name bostr -p 8080:8080 bostr:local
|
||||
docker build -t bostr:local .
|
||||
docker run --rm --name bostr -p 8080:8080 -v ./config.js:/usr/src/app/config.js bostr:local
|
||||
```
|
||||
|
||||
## License
|
||||
|
@ -13,6 +13,8 @@ services:
|
||||
context: .
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
volumes:
|
||||
- ./config.js:/usr/src/app/config.js
|
||||
ports:
|
||||
- 8080:8080
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user