-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
162 lines (151 loc) · 4.6 KB
/
docker-compose.yml
File metadata and controls
162 lines (151 loc) · 4.6 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
158
159
160
161
162
## See README for instructions on building images, etc.
services:
### ---- lucee
lucee:
image: ghcr.io/isapir/lucee-alpine:${LUCEE_VERSION}
container_name: ${PROJECT_ID}-lucee
build:
context: ./build/lucee-alpine
dockerfile: Dockerfile
args:
- GROUP_ID=1000
- LUCEE_VERSION=${LUCEE_VERSION}
- LUCEE_ADMIN_PASSWORD=${LUCEE_ADMIN_PASSWORD}
- LUCEE_EXTENSIONS=${LUCEE_EXTENSIONS}
## TODO: depends_on is ignored during build? consider switching to ubuntu image
# depends_on:
# - builder-alpine
# - tomcat-alpine
env_file: .env
volumes:
- "${HOST_APP_WEBROOT}:${LUCEE_APP_WEBROOT}"
- "${HOST_APP_CONFIG}/lucee-server/context:/srv/www/lucee-server/context"
- "${HOST_APP_LOGS}/lucee:/srv/www/lucee-server/context/logs"
- "${HOST_APP_LOGS}/tomcat:/srv/www/catalina-base/logs"
## to map Lucee cfml context, e.g. https://github.com/lucee/Lucee/tree/master/core/src/main/cfml/context
# - "~/Code/lucee/6.x/core/src/main/cfml/context:/mnt/lucee-src-cfml-context"
user: "${RUNAS_USER}"
ports:
- "${HOST_PORT_LUCEE}:8080"
# pid: "host"
### uncomment for troubleshooting
# entrypoint: /bin/bash
# stdin_open: true # docker run -i
# tty: true # docker run -t
### ---- nginx
nginx:
image: ghcr.io/isapir/nginx-alpine:${NGINX_VERSION}
container_name: ${PROJECT_ID}-nginx
build:
context: ./build/nginx-alpine
dockerfile: Dockerfile
args:
- NGINX_VERSION=${NGINX_VERSION}
- NGINX_OPENSSL_VERSION=${NGINX_OPENSSL_VERSION}
- NGINX_ZLIB_VERSION=${NGINX_ZLIB_VERSION}
env_file: .env
volumes:
- "${HOST_APP_CONFIG}/nginx:/usr/local/nginx/conf"
- "${HOST_APP_LOGS}/nginx:/usr/local/nginx/logs"
- "${HOST_APP_WEBROOT}:/srv/www/app/webroot"
user: "${RUNAS_USER}"
ports:
- "${HOST_PORT_NGINX}:80"
# pid: "host"
### uncomment for troubleshooting
# entrypoint: /bin/sh
# stdin_open: true # docker run -i
# tty: true # docker run -t
### ---- postgres
postgres:
image: postgres:${POSTGRES_VERSION}
container_name: ${PROJECT_ID}-postgres
env_file: .env
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
## host dir should be created beforehand by ${RUNAS_USER}
- "${HOST_APP_DATA}/postgres:/var/lib/postgresql/data"
## map host users to container with readonly mount so that user would work
- "/etc/passwd:/etc/passwd:ro"
## use user:group from env file which should be in host /etc/passwd
user: ${RUNAS_USER}
ports:
- "${HOST_PORT_POSTGRES}:5432"
# pid: "host"
stop_grace_period: 7s
profiles:
- postgres
### ---- mysql
mysql:
image: mysql:${MYSQL_VERSION}
container_name: ${PROJECT_ID}-mysql
environment:
- MYSQL_DATABASE=${MYSQL_DB}
- MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
volumes:
## host dir should be created beforehand by ${RUNAS_USER}
- "${HOST_APP_DATA}/mysql:/var/lib/mysql"
# user: ${RUNAS_USER}
ports:
- "${HOST_PORT_MYSQL}:3306"
# pid: "host"
stop_grace_period: 7s
profiles:
- mysql
### ---- redis
redis:
image: redis:7
container_name: ${PROJECT_ID}-redis
ports:
- "${HOST_PORT_REDIS}:6379"
# pid: "host"
profiles:
- redis
### ---- elasticsearch
elasticsearch:
image: elasticsearch:8.5.3
container_name: ${PROJECT_ID}-elasticsearch
environment:
- discovery.type=single-node
- xpack.security.enabled=false
volumes:
- ${HOST_APP_DATA}/elasticsearch:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
profiles:
- elasticsearch
### ---- test email sending
mailhog:
image: mailhog/mailhog
container_name: ${PROJECT_ID}-mailhog
expose:
- 1025
ports:
- "8025:8025"
# pid: "host"
profiles:
- mailhog
#### Helper images below used for Build stages only, therefore deploy/replicas: 0
### ---- helper image for multistage builds
builder-alpine:
image: ghcr.io/isapir/builder-alpine
container_name: ${PROJECT_ID}-builder-alpine
build:
context: ./build/builder-alpine
dockerfile: Dockerfile
deploy:
replicas: 0
### ---- helper image base for lucee
tomcat-alpine:
image: ghcr.io/isapir/tomcat-alpine:${TOMCAT_VERSION}
container_name: ${PROJECT_ID}-tomcat-alpine
build:
context: ./build/tomcat-alpine
dockerfile: Dockerfile
args:
- TOMCAT_VERSION=${TOMCAT_VERSION}
deploy:
replicas: 0