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
+3 -1
View File
@@ -1,3 +1,5 @@
/repositories /repositories
repo/
db_backups db_backups
build
node_modules
.github
+2 -3
View File
@@ -5,13 +5,12 @@ EXPOSE $PORT
WORKDIR /app WORKDIR /app
RUN npm install pm2 -g RUN npm install pm2 -g && pm2 install typescript && npm cache clean --force;
RUN pm2 install typescript
COPY package.json . COPY package.json .
COPY package-lock.json . COPY package-lock.json .
RUN npm install RUN npm install && npm run build && npm cache clean --force
COPY ecosystem.config.js . COPY ecosystem.config.js .
COPY healthcheck.js . COPY healthcheck.js .
+9 -4
View File
@@ -10,8 +10,6 @@ services:
environment: environment:
- REDIS_HOSTNAME=redis - REDIS_HOSTNAME=redis
- DB_HOSTNAME=mongodb - DB_HOSTNAME=mongodb
volumes:
- .:/app
ports: ports:
- $PORT:$PORT - $PORT:$PORT
healthcheck: healthcheck:
@@ -28,12 +26,19 @@ services:
redis: redis:
image: "redis:alpine" image: "redis:alpine"
restart: always
healthcheck:
test:
- CMD
- redis-cli
- ping
interval: 10s
timeout: 10s
retries: 5
mongodb: mongodb:
image: mongo:latest image: mongo:latest
restart: on-failure restart: on-failure
ports:
- "127.0.0.1:27017:27017"
environment: environment:
MONGO_INITDB_ROOT_USERNAME: $DB_USERNAME MONGO_INITDB_ROOT_USERNAME: $DB_USERNAME
MONGO_INITDB_ROOT_PASSWORD: $DB_PASSWORD MONGO_INITDB_ROOT_PASSWORD: $DB_PASSWORD