Add description of railway deploy, update docker compose to better align with swarm config
This commit is contained in:
98
12-deploying-containers/docker-swarm/docker-swarm.yml
Normal file
98
12-deploying-containers/docker-swarm/docker-swarm.yml
Normal file
@ -0,0 +1,98 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
client-react-nginx:
|
||||
image: sidpalas/devops-directive-docker-course-client-react-nginx:5
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
update_config:
|
||||
order: start-first
|
||||
networks:
|
||||
- frontend
|
||||
ports:
|
||||
- 80:80
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost/ping"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
api-node:
|
||||
image: sidpalas/devops-directive-docker-course-api-node:8
|
||||
read_only: true
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 1
|
||||
update_config:
|
||||
order: start-first
|
||||
environment:
|
||||
- DATABASE_URL_FILE=/run/secrets/database-url
|
||||
secrets:
|
||||
- database-url
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
ports:
|
||||
- 3000:3000
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "/usr/src/app/healthcheck.js"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
api-golang:
|
||||
image: sidpalas/devops-directive-docker-course-api-golang:7
|
||||
read_only: true
|
||||
deploy:
|
||||
mode: replicated
|
||||
replicas: 2
|
||||
update_config:
|
||||
order: start-first
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
init: true
|
||||
environment:
|
||||
- DATABASE_URL_FILE=/run/secrets/database-url
|
||||
secrets:
|
||||
- database-url
|
||||
ports:
|
||||
- 8080:8080
|
||||
healthcheck:
|
||||
test: ["CMD", "/healthcheck"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
db:
|
||||
image: postgres:15.1-alpine
|
||||
networks:
|
||||
- backend
|
||||
ports:
|
||||
- 5432:5432
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
environment:
|
||||
- PGUSER=postgres
|
||||
- POSTGRES_PASSWORD_FILE=/run/secrets/postgres-passwd
|
||||
secrets:
|
||||
- postgres-passwd
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
networks:
|
||||
frontend:
|
||||
backend:
|
||||
|
||||
secrets:
|
||||
database-url:
|
||||
external: true
|
||||
postgres-passwd:
|
||||
external: true
|
||||
Reference in New Issue
Block a user