102 lines
1.8 KiB
YAML
102 lines
1.8 KiB
YAML
services:
|
|
api1:
|
|
container_name: api1
|
|
hostname: api1
|
|
image: payment2:latest
|
|
networks:
|
|
- backend
|
|
- payment-processor
|
|
depends_on:
|
|
- redis
|
|
- database
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.35"
|
|
memory: "90MB"
|
|
|
|
|
|
api2:
|
|
container_name: api2
|
|
hostname: api2
|
|
image: payment2:latest
|
|
depends_on:
|
|
- redis
|
|
- database
|
|
networks:
|
|
- backend
|
|
- payment-processor
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.35"
|
|
memory: "90MB"
|
|
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
container_name: nginx
|
|
hostname: nginx
|
|
ports:
|
|
- "9999:9999"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
- api1
|
|
- api2
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.1"
|
|
memory: "10MB"
|
|
|
|
redis:
|
|
image: redis:7.2-alpine
|
|
hostname: redis
|
|
platform: linux/amd64
|
|
ports:
|
|
- "6379:6379"
|
|
networks:
|
|
- backend
|
|
volumes:
|
|
- redis_data1:/data
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.20"
|
|
memory: "70MB"
|
|
|
|
database:
|
|
container_name: database
|
|
image: postgres:alpine
|
|
hostname: database
|
|
platform: linux/amd64
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
- POSTGRES_DB=payment
|
|
- POSTGRES_USER=postgres
|
|
- POSTGRES_PASSWORD=postgres_pwd
|
|
volumes:
|
|
- database_volume1:/var/lib/postgresql/data
|
|
- ./docker/db_init.sql:/docker-entrypoint-initdb.d/
|
|
networks:
|
|
- backend
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "0.50"
|
|
memory: "90MB"
|
|
|
|
networks:
|
|
backend:
|
|
driver: bridge
|
|
payment-processor:
|
|
external: true
|
|
|
|
volumes:
|
|
database_volume1:
|
|
redis_data1:
|