Add container security section
This commit is contained in:
71
12-deploying-containers/docker-compose-prod.yml
Normal file
71
12-deploying-containers/docker-compose-prod.yml
Normal file
@ -0,0 +1,71 @@
|
||||
version: '3.7'
|
||||
|
||||
services:
|
||||
client-react-nginx:
|
||||
image: sidpalas/devops-directive-docker-course-client-react-nginx:5
|
||||
networks:
|
||||
- frontend
|
||||
init: true
|
||||
ports:
|
||||
- 80:80
|
||||
restart: unless-stopped
|
||||
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
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
init: true
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:foobarbaz@db:5432/postgres
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "node", "src/healthcheck.js"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
api-golang:
|
||||
image: sidpalas/devops-directive-docker-course-api-golang:7
|
||||
networks:
|
||||
- frontend
|
||||
- backend
|
||||
init: true
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:foobarbaz@db:5432/postgres
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "/healthcheck"]
|
||||
interval: 30s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
start_period: 10s
|
||||
db:
|
||||
image: postgres:15.1-alpine
|
||||
networks:
|
||||
- backend
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_PASSWORD=foobarbaz
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
|
||||
networks:
|
||||
frontend:
|
||||
backend:
|
||||
Reference in New Issue
Block a user