fix(#166): fix docker build

This commit is contained in:
tdurieux
2023-02-13 08:14:48 +01:00
parent cff3636523
commit 3ab9b0c7a4
3 changed files with 16 additions and 10 deletions

View File

@@ -1,3 +1,5 @@
/repositories
repo/
db_backups
db_backups
build
node_modules
.github

View File

@@ -5,13 +5,12 @@ EXPOSE $PORT
WORKDIR /app
RUN npm install pm2 -g
RUN pm2 install typescript
RUN npm install pm2 -g && pm2 install typescript && npm cache clean --force;
COPY package.json .
COPY package-lock.json .
RUN npm install
RUN npm install && npm run build && npm cache clean --force
COPY ecosystem.config.js .
COPY healthcheck.js .

View File

@@ -10,8 +10,6 @@ services:
environment:
- REDIS_HOSTNAME=redis
- DB_HOSTNAME=mongodb
volumes:
- .:/app
ports:
- $PORT:$PORT
healthcheck:
@@ -28,12 +26,19 @@ services:
redis:
image: "redis:alpine"
restart: always
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 10s
timeout: 10s
retries: 5
mongodb:
image: mongo:latest
restart: on-failure
ports:
- "127.0.0.1:27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: $DB_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $DB_PASSWORD