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
|
# Leverage a bind mounts to package.json and package-lock.json to avoid having to copy them into
|
||||||
# into this layer.
|
# into this layer.
|
||||||
RUN --mount=type=bind,source=package.json,target=package.json \
|
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 \
|
--mount=type=cache,target=/root/.npm \
|
||||||
npm ci --omit=dev
|
npm i --omit=dev
|
||||||
|
|
||||||
# Run the application as a non-root user.
|
# Run the application as a non-root user.
|
||||||
USER node
|
USER node
|
||||||
|
@ -48,10 +48,8 @@ tmux new -d "node index.js"
|
|||||||
```
|
```
|
||||||
git clone https://github.com/mroxso/bostr
|
git clone https://github.com/mroxso/bostr
|
||||||
cd bostr
|
cd bostr
|
||||||
npm i
|
docker build -t bostr:local .
|
||||||
cp config.js.example config.js
|
docker run --rm --name bostr -p 8080:8080 -v ./config.js:/usr/src/app/config.js bostr:local
|
||||||
docker build -t bostr:local
|
|
||||||
docker run --rm --name bostr -p 8080:8080 bostr:local
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
@ -13,6 +13,8 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
environment:
|
environment:
|
||||||
NODE_ENV: production
|
NODE_ENV: production
|
||||||
|
volumes:
|
||||||
|
- ./config.js:/usr/src/app/config.js
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user