feat: Add combined Dockerfile for Swarm/Portainer deployment
- Create single Dockerfile that builds frontend and backend together - Add nginx.conf for combined container (proxies to localhost) - Update docker-compose.prod.yml for Swarm compatibility: - Use pre-built image instead of build directive - Replace restart with deploy.restart_policy - Single 'app' service instead of separate backend/frontend
This commit is contained in:
+8
-29
@@ -7,20 +7,15 @@ services:
|
||||
command: redis-server --appendonly yes
|
||||
volumes:
|
||||
- /mnt/DockerMount/minio-webui/redis:/data
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- minio-webui-network
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: unless-stopped
|
||||
|
||||
# Backend API
|
||||
backend:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: ../docker/Dockerfile.backend
|
||||
# Combined app (backend + frontend)
|
||||
app:
|
||||
image: theluap/minio-webui:latest
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
@@ -53,25 +48,9 @@ services:
|
||||
- /mnt/DockerMount/minio-webui/mc-config:/home/nodejs/.mc
|
||||
depends_on:
|
||||
- redis
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- minio-webui-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 3
|
||||
start_period: 40s
|
||||
|
||||
# Frontend (nginx + React)
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: ../docker/Dockerfile.frontend
|
||||
depends_on:
|
||||
- backend
|
||||
restart: unless-stopped
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: unless-stopped
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.routers.minio-webui.rule=Host(`minio-webui.local.nothaft.cloud`)"
|
||||
|
||||
Reference in New Issue
Block a user