mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
Compare commits
2 commits
5c75347887
...
b3d65e0a1e
| Author | SHA1 | Date | |
|---|---|---|---|
| b3d65e0a1e | |||
| 567a765f94 |
4 changed files with 30 additions and 11 deletions
|
|
@ -12,9 +12,10 @@ RUN npm install
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 5173
|
ENV PORT=5173
|
||||||
|
EXPOSE ${PORT}
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
|
||||||
CMD curl -f http://localhost:5173 || exit 1
|
CMD curl -f http://localhost:${PORT} || exit 1
|
||||||
|
|
||||||
CMD [ "npm", "run", "preview" ]
|
CMD [ "npm", "run", "preview" ]
|
||||||
|
|
@ -3,21 +3,29 @@ version: '3'
|
||||||
services:
|
services:
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
|
container_name: frontend
|
||||||
build:
|
build:
|
||||||
context: ./client
|
context: ./client
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: frontend
|
|
||||||
ports:
|
ports:
|
||||||
- "5173:5173"
|
- "5173:5173"
|
||||||
networks:
|
networks:
|
||||||
- quiz_network
|
- quiz_network
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "curl -f http://localhost:$${PORT} || exit 1"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
start_period: 5s
|
||||||
|
retries: 6
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./server
|
context: ./server
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: backend
|
container_name: backend
|
||||||
|
networks:
|
||||||
|
- quiz_network
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
|
|
@ -30,14 +38,15 @@ services:
|
||||||
SENDER_EMAIL: infoevaluetonsavoir@gmail.com
|
SENDER_EMAIL: infoevaluetonsavoir@gmail.com
|
||||||
EMAIL_PSW: 'vvml wmfr dkzb vjzb'
|
EMAIL_PSW: 'vvml wmfr dkzb vjzb'
|
||||||
JWT_SECRET: haQdgd2jp09qb897GeBZyJetC8ECSpbFJe
|
JWT_SECRET: haQdgd2jp09qb897GeBZyJetC8ECSpbFJe
|
||||||
FRONTEND_URL: "http://localhost:5173"
|
|
||||||
#QUIZROOM_IMAGE: ghcr.io/ets-cfuhrman-pfe/evaluetonsavoir-quizroom:latest
|
|
||||||
depends_on:
|
depends_on:
|
||||||
mongo:
|
mongo:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
networks:
|
healthcheck:
|
||||||
- quiz_network
|
test: ["CMD-SHELL", "curl -f http://localhost:$${PORT}/health || exit 1"]
|
||||||
restart: always
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
start_period: 5s
|
||||||
|
retries: 6
|
||||||
|
|
||||||
quizroom: # Forces image to update
|
quizroom: # Forces image to update
|
||||||
build:
|
build:
|
||||||
|
|
@ -49,6 +58,12 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- quiz_network
|
- quiz_network
|
||||||
restart: always
|
restart: always
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "/usr/src/app/healthcheck.sh"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 10s
|
||||||
|
start_period: 5s
|
||||||
|
retries: 6
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
|
|
@ -72,7 +87,7 @@ services:
|
||||||
# - BACKEND_HOST=backend
|
# - BACKEND_HOST=backend
|
||||||
# - BACKEND_PORT=3000
|
# - BACKEND_PORT=3000
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "wget --spider http://0.0.0.0:${PORT}/health || exit 1"]
|
test: ["CMD-SHELL", "wget --spider http://0.0.0.0:$${PORT}/health || exit 1"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 10s
|
timeout: 10s
|
||||||
start_period: 5s
|
start_period: 5s
|
||||||
|
|
|
||||||
|
|
@ -61,6 +61,7 @@ RUN echo 'load_module modules/ngx_http_js_module.so;' > /tmp/nginx.conf && \
|
||||||
COPY templates/default.conf /etc/nginx/templates/
|
COPY templates/default.conf /etc/nginx/templates/
|
||||||
COPY njs/main.js /etc/nginx/njs/
|
COPY njs/main.js /etc/nginx/njs/
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN dos2unix /entrypoint.sh
|
||||||
|
|
||||||
ENV PORT=80 \
|
ENV PORT=80 \
|
||||||
FRONTEND_HOST=frontend \
|
FRONTEND_HOST=frontend \
|
||||||
|
|
@ -85,4 +86,5 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD wget -q --spider http://0.0.0.0:${PORT}/health || exit 1
|
CMD wget -q --spider http://0.0.0.0:${PORT}/health || exit 1
|
||||||
|
|
||||||
# Start Nginx using entrypoint script
|
# Start Nginx using entrypoint script
|
||||||
ENTRYPOINT ["/entrypoint.sh"]
|
# CMD [ "/bin/sh","-c","sleep 3600" ] # For debugging
|
||||||
|
ENTRYPOINT [ "/entrypoint.sh" ]
|
||||||
|
|
@ -8,7 +8,8 @@ RUN npm install
|
||||||
|
|
||||||
COPY ./ .
|
COPY ./ .
|
||||||
|
|
||||||
EXPOSE 4400
|
ENV PORT=3000
|
||||||
|
EXPOSE ${PORT}
|
||||||
|
|
||||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||||
CMD curl -f http://localhost:${PORT}/health || exit 1
|
CMD curl -f http://localhost:${PORT}/health || exit 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue