feat: use docker swarm setup
This commit is contained in:
+14
-50
@@ -1,18 +1,16 @@
|
||||
version: "3.9"
|
||||
|
||||
services:
|
||||
app:
|
||||
restart: always
|
||||
build: .
|
||||
# ports:
|
||||
# - 8093:3000
|
||||
# - 80:3000
|
||||
image: git.dgnr.us/${{ gitea.repository }}:frontend
|
||||
deploy:
|
||||
replicas: 4
|
||||
resources:
|
||||
limits:
|
||||
cpus: "4.0"
|
||||
memory: 1024M
|
||||
replicas: 4
|
||||
volumes:
|
||||
- ./data/prod:/app/data
|
||||
restart_policy:
|
||||
condition: any
|
||||
stop_grace_period: 1s
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/')"]
|
||||
@@ -20,58 +18,24 @@ services:
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
ports:
|
||||
- "8093:3000"
|
||||
networks:
|
||||
- buzz
|
||||
|
||||
backend:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend.dockerfile
|
||||
restart: on-failure
|
||||
stop_grace_period: 1s
|
||||
networks:
|
||||
- buzz
|
||||
|
||||
backup:
|
||||
restart: always
|
||||
build: .
|
||||
ports:
|
||||
- 8095:3000
|
||||
# - 80:3000
|
||||
environment:
|
||||
- DISCORD_REDIRECT_URI=https://buzzy.sudloh.com/rubgram/callback
|
||||
- BASE_URL=https://buzzy.sudloh.com
|
||||
image: git.dgnr.us/${{ gitea.repository }}:backend
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: "4.0"
|
||||
memory: 1024M
|
||||
volumes:
|
||||
- ./data/prod:/app/data
|
||||
cpus: "1.0"
|
||||
memory: 512M
|
||||
restart_policy:
|
||||
condition: any
|
||||
stop_grace_period: 1s
|
||||
healthcheck:
|
||||
test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/')"]
|
||||
interval: 60s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 5s
|
||||
dns:
|
||||
- 127.0.0.11
|
||||
- 1.1.1.1
|
||||
|
||||
nginx:
|
||||
restart: always
|
||||
image: nginx:stable-alpine
|
||||
ports:
|
||||
- "8093:80" # Map host primary buzzy port to container port 80
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro # Mount Nginx config
|
||||
depends_on:
|
||||
- app # Ensure backend starts before Nginx
|
||||
networks:
|
||||
- buzz
|
||||
stop_grace_period: 1s
|
||||
|
||||
networks:
|
||||
buzz:
|
||||
driver: bridge
|
||||
driver: overlay
|
||||
|
||||
Reference in New Issue
Block a user