Skip to content

Commit

Permalink
docker: tidy up
Browse files Browse the repository at this point in the history
- don't install every package globally;
- don't reinstall them through Docker-Compose;
- remove obsolete service;
- remove ignored env variable.
  • Loading branch information
freesteph committed Apr 20, 2022
1 parent 9482afa commit 2061580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
15 changes: 6 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
FROM node:lts

WORKDIR /app
RUN npm i -g nodemon typescript

RUN chown node:node /app
USER node

COPY . .
WORKDIR /app

RUN npm install -g nodemon
RUN npm install typescript -g
RUN npm install -g
COPY --chown=node . .

USER node
RUN npm i

EXPOSE 8100
RUN npm run dev
CMD npm run migrate && npm run dev
7 changes: 1 addition & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ services:
- "5432:5432"
web:
build: .
command: bash -c "echo 'first npm install can be a bit long'; npm install; npm run migrate; npm run dev"
depends_on:
- db
- maildev
env_file:
- .env
environment:
DATABASE_URL: postgres://bbbanalytics:bbbanalytics@db:5432/bbbanalytics
SECURE: "false"
HOSTNAME: localhost
JWT_SECURITY_SALT: "SecretThatShouldChangedInProduction"
JWT_SECURITY_SALT: SecretThatShouldChangedInProduction
ports:
- "8100:8100"
- "9229:9229"
Expand Down

0 comments on commit 2061580

Please sign in to comment.