-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
74 lines (71 loc) · 2.15 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
version: '3'
services:
server:
container_name: moki.codes
build:
context: .
# dockerfile: Dockerfile-dev
dockerfile: Dockerfile-prod
# production server is hidden behind reverse proxy
#expose:
# - ${SERVER_CONTAINER_PORT}
# development server exposed raw
ports:
- ${SERVER_HOST_PORT}:${SERVER_CONTAINER_PORT}
environment:
- GOLANG_ENV=${GOLANG_ENV}
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
- PERSISTENT_STORAGE_HOST=${PERSISTENT_STORAGE_HOST}
- PERSISTENT_STORAGE_PORT=${PERSISTENT_STORAGE_PORT}
- PERSISTENT_STORAGE_USER=${PERSISTENT_STORAGE_USER}
- PERSISTENT_STORAGE_PASSWORD=${PERSISTENT_STORAGE_PASSWORD}
- PERSISTENT_STORAGE_DB_NAME=${PERSISTENT_STORAGE_DB_NAME}
- VIRTUAL_HOST=${VIRTUAL_HOST}
- VIRTUAL_PORT=${VIRTUAL_PORT}
- LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
networks:
- server
# - proxy
restart: unless-stopped
depends_on:
- persistent-storage
persistent-storage:
container_name: postgres.moki.codes
image: postgres:alpine
expose:
- '5432'
volumes:
- postgres.moki.codes:/var/lib/postgresql/data
- ./pg_hba.conf:/etc/postgresql/pg_hba.conf
- ./postgresql.conf:/etc/postgresql/postgresql.conf
- ./commit-pg_hba.sh:/etc/postgresql/commit-pg_hba.sh
environment:
- POSTGRES_USER=${PERSISTENT_STORAGE_USER}
- POSTGRES_PASSWORD=${PERSISTENT_STORAGE_PASSWORD}
- POSTGRES_DB=${PERSISTENT_STORAGE_DB_NAME}
networks:
- server
command: postgres -c 'config_file=/etc/postgresql/postgresql.conf'
#frontend-server:
# image: nginx:alpine
# expose:
# - ${VIRTUAL_PORT}
# environment:
# - VIRTUAL_HOST=${VIRTUAL_HOST}
# - VIRTUAL_PORT=${VIRTUAL_PORT}
# - LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
# - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
# volumes:
# - ./build:/usr/share/nginx/html:ro
# - ./nginx.conf:/etc/nginx/nginx.conf:ro
# networks:
# - proxy
# restart: unless-stopped
volumes:
postgres.moki.codes:
networks:
server:
# proxy:
# external:
# name: nginx-proxy