fix dockerfile and use external config.js

This commit is contained in:
mroxso 2023-11-05 20:37:54 +01:00
parent 52d92de8fa
commit 685e80e639
3 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -13,6 +13,8 @@ services:
context: .
environment:
NODE_ENV: production
volumes:
- ./config.js:/usr/src/app/config.js
ports:
- 8080:8080