-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (123 loc) · 2.96 KB
/
docker-compose.yml
File metadata and controls
157 lines (123 loc) · 2.96 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
version: '3.8'
x-DbLoggin:
environment: &postgres-login # the POSTGRES user master password
POSTGRES_PASSWORD: '${POSTGRES_MASTER_PASSWORD}'
USER_USERNAME: '${POSTGRES_USER_USERNAME}'
USER_DB_NAME: '${POSTGRES_USER_DB}'
USER_PASSWORD: '${POSTGRES_USER_PASSWORD}'
POSTGRES_IP: postgres_db
POSTGRES_PORT: ${POSTGRES_PORT}
SQLURL: 'jdbc:postgresql://${POSTGRES_IP}:5432/${POSTGRES_USER_DB}'
networks: &postgres-ip
ipv4_address: '${POSTGRES_IP}'
services:
postgres_db:
image: postgres
environment:
<<: *postgres-login
PGDATA: '/var/lib/postgresql/data/pgdata'
networks:
local_network: *postgres-ip
volumes:
- type: volume
source: postgres_db
target: /var/lib/postgresql/data
- type: bind
source: ./docker_files/db_init
target: /docker-entrypoint-initdb.d
restart: unless-stopped
web_server:
build:
context: ./web/
dockerfile: ./api/Dockerfile
environment:
<<: *postgres-login
JWT_SECRET: ${JWT_SECRET}
API_PORT: ${API_PORT}
volumes:
- type: volume
source: fractal_thumbnail_images
target: /fractal_thumbnail_images
- type: bind
source: $PWD/web/api/
target: /usr/src/app
- type: volume
source: node_modules
target: /usr/src/app/node_modules
networks:
local_network:
ipv4_address: '${WEBSERVER_IP}'
depends_on:
- server
ports:
- '9988:8080'
restart: unless-stopped
server:
build:
context: ./server
dockerfile: Dockerfile
environment:
<<: *postgres-login
NODE_URL: '${NODE_URL}'
volumes:
- type: volume
source: fractal_thumbnail_images
target: /fractal_thumbnail_images
- type: volume
source: maven_data
target: /root/.m2
networks:
local_network:
frontend:
ports:
- '9876:9876'
depends_on:
- postgres_db
restart: unless-stopped
# https://github.com/mikael2/payara-postgres-nginx/
nginx:
container_name: nginx
build:
context: ./docker_files/nginx_certbot
dockerfile: Dockerfile
volumes:
- type: volume
source: nginx_data
target: /etc/letsencrypt
- type: bind
source: /web/frontend
target: /www/fractal/
env_file:
- ./config_files/nginx_cerbot.env
environment:
DOMAIN: '${API_DOMAIN}'
LE_EMAIL: '${MAIL_USERNAME}'
logging:
options:
max-size: '50m'
max-file: '3'
ports:
- '80:80'
- '443:443'
networks:
frontend:
local_network:
depends_on:
- web_server
restart: unless-stopped
networks:
local_network:
external: false
ipam:
driver: default
config:
- subnet: 10.0.0.0/8
frontend:
volumes:
# posgres db
postgres_db:
# thumbnail images
fractal_thumbnail_images:
maven_data:
node_modules:
nginx_data: