-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
57 lines (53 loc) · 1.61 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
version: '3'
services:
server:
container_name: server
env_file:
- .env
build: .
ports:
- 50051:50051
restart: on-failure
depends_on:
- postgres-db
volumes:
- ${CERTS_PATH}:/certs:ro # in production, change this CERTS_PATH to your certificate files folder
- ${CONFIG_PATH}:/config.yml:ro # mount config file
networks:
- internal
postgres-db:
image: postgres:alpine
container_name: postgres
command: postgres -c config_file=/etc/postgresql/postgresql.conf -c logging_collector=on -c log_destination=stderr -c log_directory=/logs
env_file:
- .env
ports:
- '5432:5432'
volumes:
- ${DB_LOGS_PATH}:/logs
- ${PSQL_CONFIG_PATH}:/etc/postgresql/postgresql.conf
- ${PSQL_DATA_PATH}:/var/lib/postgresql/data
networks:
- internal
# It easier and better to use another tools in order to visualize the DB content
# pgadmin:
# image: dpage/pgadmin4
# container_name: pgadmin_container
# env_file:
# - .env
# depends_on:
# - postgres-db
# ports: # will be used in secure communication
# - "5050:443" # port 443 binded instead of 80
# volumes:
# - ${CERTS_PATH}/cli2.sec-aau.dk/fullchain.pem:/certs/server.cert # binded to use given certs in env file
# - ${CERTS_PATH}/cli2.sec-aau.dk/privkey.pem:/certs/server.key
# networks:
# - internal
# restart: unless-stopped
# logging:
# driver: none # disable logs for this service
# Networks to be created to facilitate communication between containers
networks:
internal:
driver: bridge