Compare commits
3 Commits
refactor/m
...
feat/docke
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
25d00dd0fb | ||
|
|
cc8e4dbb77 | ||
|
|
be060cbfb7 |
@@ -21,7 +21,7 @@ RUN \
|
||||
npm config set fetch-retries 5 ; \
|
||||
npm config set fetch-retry-mintimeout 15000 ; \
|
||||
npm install --no-audit; \
|
||||
# React client build
|
||||
# Build React client
|
||||
NODE_OPTIONS="--max-old-space-size=2048" npm run frontend; \
|
||||
npm prune --production; \
|
||||
npm cache clean --force
|
||||
@@ -31,6 +31,12 @@ RUN mkdir -p /app/client/public/images /app/api/logs
|
||||
# Node API setup
|
||||
EXPOSE 3080
|
||||
ENV HOST=0.0.0.0
|
||||
|
||||
# Define a health check
|
||||
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD curl -f http://localhost:3080/health
|
||||
|
||||
# Start the backend service
|
||||
CMD ["npm", "run", "backend"]
|
||||
|
||||
# Optional: for client with nginx routing
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Do not edit this file directly. Use a ‘docker-compose.override.yaml’ file if you can.
|
||||
# Refer to `docker-compose.override.yaml.example’ for some sample configurations.
|
||||
# Refer to `docker-compose.override.yaml.example` for some sample configurations.
|
||||
|
||||
services:
|
||||
api:
|
||||
@@ -27,6 +27,13 @@ services:
|
||||
- ./images:/app/client/public/images
|
||||
- ./uploads:/app/uploads
|
||||
- ./logs:/app/api/logs
|
||||
healthcheck:
|
||||
test: [ "CMD", "curl", "-f", "http://api:${PORT}/health" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 30s
|
||||
|
||||
mongodb:
|
||||
container_name: chat-mongodb
|
||||
image: mongo
|
||||
|
||||
Reference in New Issue
Block a user