-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
60 lines (58 loc) · 1.48 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Modified version of https://github.com/sosedoff/pgweb/blob/master/docker-compose.yml
services:
# docker compose up postgres -d
postgres:
container_name: postgres
image: postgres:latest
ports:
- 5433:5432
# Disabling persistence to allow for the program to be run multiple times
volumes:
- data:/var/lib/postgresql/data
# environment:
# POSTGRES_DB: "db"
# POSTGRES_PASSWORD: "dbpass"
# POSTGRES_USER: "dbuser"
env_file:
- .env
healthcheck:
# https://stackoverflow.com/a/73049146
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"]
interval: 5s
networks:
- db-net
pystodon:
container_name: pystodon
# Build ./Dockerfile
build:
context: .
dockerfile: Dockerfile
env_file:
- .env
networks:
- db-net
depends_on:
postgres:
condition: service_healthy
# pgweb is a web-based database browser for PostgreSQL if you want to check the database via a web interface
# pgweb:
# container_name: pgweb
# image: sosedoff/pgweb
# ports:
# - 8081:8081
# env_file:
# - .env
# networks:
# - db-net
# depends_on:
# postgres:
# condition: service_healthy
# healthcheck:
# test: ["CMD", "nc", "-vz", "127.0.0.1", "8081"]
# interval: 5s
volumes:
data:
name: pystodon
networks:
db-net:
name: db-net