2020-03-05 16:39:16 +00:00
|
|
|
services:
|
|
|
|
backend:
|
2022-07-12 08:08:02 +00:00
|
|
|
build:
|
|
|
|
context: backend
|
|
|
|
target: builder
|
2020-03-05 16:39:16 +00:00
|
|
|
secrets:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-password
|
2020-03-05 16:39:16 +00:00
|
|
|
depends_on:
|
2022-07-12 08:08:02 +00:00
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
|
2020-03-05 16:39:16 +00:00
|
|
|
db:
|
|
|
|
image: postgres
|
|
|
|
restart: always
|
2022-07-12 08:08:02 +00:00
|
|
|
user: postgres
|
2020-03-05 16:39:16 +00:00
|
|
|
secrets:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-password
|
2020-03-05 16:39:16 +00:00
|
|
|
volumes:
|
2020-03-23 23:36:46 +00:00
|
|
|
- db-data:/var/lib/postgresql/data
|
|
|
|
environment:
|
|
|
|
- POSTGRES_DB=example
|
|
|
|
- POSTGRES_PASSWORD_FILE=/run/secrets/db-password
|
2021-04-30 20:29:16 +00:00
|
|
|
expose:
|
|
|
|
- 5432
|
2022-07-12 08:08:02 +00:00
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "pg_isready" ]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 5s
|
|
|
|
retries: 5
|
|
|
|
|
2020-03-05 16:39:16 +00:00
|
|
|
proxy:
|
2022-07-12 08:08:02 +00:00
|
|
|
image: nginx
|
|
|
|
volumes:
|
|
|
|
- type: bind
|
|
|
|
source: ./proxy/nginx.conf
|
|
|
|
target: /etc/nginx/conf.d/default.conf
|
|
|
|
read_only: true
|
2020-03-05 16:39:16 +00:00
|
|
|
ports:
|
2020-03-23 23:36:46 +00:00
|
|
|
- 80:80
|
2020-03-05 16:39:16 +00:00
|
|
|
depends_on:
|
2020-03-23 23:36:46 +00:00
|
|
|
- backend
|
2022-07-12 08:08:02 +00:00
|
|
|
|
2020-03-05 16:39:16 +00:00
|
|
|
volumes:
|
2020-03-23 23:36:46 +00:00
|
|
|
db-data:
|
2022-07-12 08:08:02 +00:00
|
|
|
|
2020-03-05 16:39:16 +00:00
|
|
|
secrets:
|
|
|
|
db-password:
|
|
|
|
file: db/password.txt
|