Skip to content

Commit 29f00de

Browse files
committed
.env file added for docker-compose and removed run.sh in docker folder and added command in docker-compose. so gunicorn and uwsgi service get pid 1.
1 parent 4fd36b9 commit 29f00de

22 files changed

Lines changed: 228 additions & 360 deletions

File tree

compose/master_service/.env

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
LOG_DRIVER=json-file
2+
LOG_OPT_MAXF=5
3+
LOG_OPT_MAXS=100m
4+
EMAIL_DELIVERY_METHOD=smtp
5+
SMTP_ADDRESS=smtp.mailgun.org
6+
SMTP_PORT=587
7+
SMTP_DOMAIN=domain
8+
SMTP_AUTHENTICATION=login
9+
SMTP_ENABLE_STARTTLS_AUTO=true
10+
SMTP_USER_NAME=id
11+
SMTP_PASSWORD=api_key
12+
PASSENGER_START_TIMEOUT=3000
13+
PROJECT_DIR=django_sample
14+
WORKERS=4
15+
GUNICORN_PORT=8000
16+
PROJECT_NAME=django_sample
17+
GUNICORN_OPITON=--reload
Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
version: "3"
22
services:
33
webserver:
4-
image: nginx:latest
4+
image: nginx:latest
55
logging:
6-
driver: "json-file"
6+
driver: "${LOG_DRIVER}"
77
options:
8-
max-file: "5"
9-
max-size: "100m"
10-
container_name: nginx-webserver
8+
max-file: "${LOG_OPT_MAXF}"
9+
max-size: "${LOG_OPT_MAXS}"
10+
container_name: nginx-webserver
1111
volumes:
1212
- ../../www:/www
1313
- ../../script/:/script/
1414
- ../../bin/certbot-auto:/usr/local/bin/certbot-auto
15-
# web php setting
15+
# web php setting
1616
- ../../config/web-server/nginx/php/conf.d/:/etc/nginx/conf.d/
1717
- ../../config/web-server/nginx/php/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
1818
- ../../config/web-server/nginx/php/fastcgi/fastcgi_params:/etc/nginx/fastcgi_params
1919
- ../../config/web-server/nginx/php/proxy_params/proxy_params:/etc/nginx/proxy_params
20-
# web gunicorn setting
20+
# web gunicorn setting
2121
# - ../../config/web-server/nginx/gunicorn/conf.d/:/etc/nginx/conf.d/
2222
# - ../../config/web-server/nginx/gunicorn/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
2323
# - ../../config/web-server/nginx/gunicorn/proxy_params/proxy_params:/etc/nginx/proxy_params
@@ -35,7 +35,7 @@ services:
3535
- "443:443"
3636
environment:
3737
TZ: "Asia/Seoul"
38-
restart: always
38+
restart: always
3939
depends_on:
4040
- php-app
4141
- openproject
@@ -46,10 +46,10 @@ services:
4646
php-app:
4747
build: ../../docker/php-fpm/
4848
logging:
49-
driver: "json-file"
49+
driver: "${LOG_DRIVER}"
5050
options:
51-
max-file: "5"
52-
max-size: "100m"
51+
max-file: "${LOG_OPT_MAXF}"
52+
max-size: "${LOG_OPT_MAXS}"
5353
working_dir: /application
5454
container_name: php-app
5555
volumes:
@@ -63,76 +63,73 @@ services:
6363
# gunicorn-app:
6464
# build: ../../docker/gunicorn/
6565
# logging:
66-
# driver: "json-file"
66+
# driver: "${LOG_DRIVER}"
6767
# options:
68-
# max-file: "5"
69-
# max-size: "100m"
70-
# working_dir: /application
71-
# container_name: gunicorn-app
68+
# max-file: "${LOG_OPT_MAXF}"
69+
# max-size: "${LOG_OPT_MAXS}"
70+
# working_dir: /www/${PROJECT_DIR}
71+
# container_name: gunicorn-app
7272
# volumes:
7373
# - ../../www:/www
7474
# - ../../log:/log
7575
# environment:
76-
# TZ: "Asia/Seoul"
77-
# command:
78-
# - /tmp/run.sh
76+
# TZ: "Asia/Seoul"
77+
# command: bash -c "pip install -r requirements.txt && gunicorn --workers ${WORKERS} --bind 0.0.0.0:${GUNICORN_PORT} ${PROJECT_NAME}.wsgi:application ${GUNICORN_OPITON}"
7978
# restart: always
8079

8180
# uwsgi-app:
8281
# build: ../../docker/uwsgi/
8382
# logging:
84-
# driver: "json-file"
83+
# driver: "${LOG_DRIVER}"
8584
# options:
86-
# max-file: "5"
87-
# max-size: "100m"
85+
# max-file: "${LOG_OPT_MAXF}"
86+
# max-size: "${LOG_OPT_MAXS}"
8887
# working_dir: /application
8988
# container_name: uwsgi-app
9089
# volumes:
9190
# - ../../www:/www
9291
# - ../../config/app-server/uwsgi/uwsgi.ini:/application/uwsgi.ini
9392
# - ../../log:/log
94-
# command:
95-
# - /tmp/run.sh
93+
# command: bash -c "pip install -r requirements.txt && uwsgi --ini /application/uwsgi.ini"
9694
# environment:
9795
# TZ: "Asia/Seoul"
98-
# restart: always
96+
# restart: always
9997

10098
openproject:
10199
image: openproject/community:11
102100
logging:
103-
driver: "json-file"
101+
driver: "${LOG_DRIVER}"
104102
options:
105-
max-file: "5"
106-
max-size: "100m"
103+
max-file: "${LOG_OPT_MAXF}"
104+
max-size: "${LOG_OPT_MAXS}"
107105
container_name: openproject
108106
privileged: true
109-
environment:
110-
EMAIL_DELIVERY_METHOD: smtp
111-
SMTP_ADDRESS: smtp.mailgun.org
112-
SMTP_PORT: 587
113-
SMTP_DOMAIN: "domain"
114-
SMTP_AUTHENTICATION: login
115-
SMTP_ENABLE_STARTTLS_AUTO: "true"
116-
SMTP_USER_NAME: "id"
117-
SMTP_PASSWORD: "api key"
118107
volumes:
119108
- ./pgdata/:/var/openproject/pgdata/
120109
- ../../log/supervisor/:/var/log/supervisor/
121110
- ./static/:/var/openproject/assets/
122111
expose:
123112
- "8080"
124113
environment:
114+
EMAIL_DELIVERY_METHOD: ${EMAIL_DELIVERY_METHOD}
115+
SMTP_ADDRESS: ${SMTP_ADDRESS}
116+
SMTP_PORT: ${SMTP_PORT}
117+
SMTP_DOMAIN: "${SMTP_DOMAIN}"
118+
SMTP_AUTHENTICATION: ${SMTP_AUTHENTICATION}
119+
SMTP_ENABLE_STARTTLS_AUTO: "${SMTP_ENABLE_STARTTLS_AUTO}"
120+
SMTP_USER_NAME: "${SMTP_USER_NAME}"
121+
SMTP_PASSWORD: "${SMTP_PASSWORD}"
125122
TZ: "Asia/Seoul"
126-
PASSENGER_START_TIMEOUT: 3000
123+
PASSENGER_START_TIMEOUT: ${PASSENGER_START_TIMEOUT}
127124
restart: always
128125

129126
jenkins:
130127
image: jenkins/jenkins:latest
131128
logging:
132-
driver: "json-file"
129+
driver: "${LOG_DRIVER}"
133130
options:
134-
max-file: "5"
135-
max-size: "100m"
131+
max-file: "${LOG_OPT_MAXF}"
132+
max-size: "${LOG_OPT_MAXS}"
136133
container_name: jenkins
137134
privileged: true
138135
volumes:
@@ -146,16 +143,16 @@ services:
146143
gitolite:
147144
build: ../../docker/gitolite
148145
logging:
149-
driver: "json-file"
146+
driver: "${LOG_DRIVER}"
150147
options:
151-
max-file: "5"
152-
max-size: "100m"
148+
max-file: "${LOG_OPT_MAXF}"
149+
max-size: "${LOG_OPT_MAXS}"
153150
working_dir: /application
154151
container_name: gitolite
155152
volumes:
156-
- ./storage:/home/gitolite-creator/repositories
157-
ports:
153+
- ./storage:/home/gitolite-creator/repositories
154+
ports:
158155
- "2222:22"
159156
environment:
160-
TZ: "Asia/Seoul"
157+
TZ: "Asia/Seoul"
161158
restart: always
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LOG_DRIVER=json-file
2+
LOG_OPT_MAXF=5
3+
LOG_OPT_MAXS=100m

compose/project_mng_service/gitolite/docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ services:
33
gitolite:
44
build: ../../../docker/gitolite
55
logging:
6-
driver: "json-file"
7-
options:
8-
max-file: "5"
9-
max-size: "100m"
6+
driver: "${LOG_DRIVER}"
7+
options:
8+
max-file: "${LOG_OPT_MAXF}"
9+
max-size: "${LOG_OPT_MAXS}"
1010
working_dir: /application
1111
container_name: gitolite
1212
volumes:
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
LOG_DRIVER=json-file
2+
LOG_OPT_MAXF=5
3+
LOG_OPT_MAXS=100m
Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,41 @@
11
version: "3"
22
services:
3-
nginx-proxy:
4-
image: nginx:latest
5-
logging:
6-
driver: "json-file"
7-
options:
8-
max-file: "5"
9-
max-size: "100m"
10-
container_name: nginx-proxy
11-
volumes:
12-
- ../../../config/web-server/nginx/php/conf.d/:/etc/nginx/conf.d/
13-
- ../../../config/web-server/nginx/php/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
14-
- ../../../config/web-server/nginx/php/fastcgi/fastcgi_params:/etc/nginx/fastcgi_params
15-
- ../../../ssl:/etc/nginx/ssl/
16-
- ../../../log/nginx/:/log/nginx/
17-
ports:
18-
- "80:80"
19-
- "443:443"
20-
environment:
21-
TZ: "Asia/Seoul"
22-
restart: always
23-
depends_on:
24-
- jenkins
25-
26-
jenkins:
27-
image: 'jenkins/jenkins:latest'
28-
logging:
29-
driver: "json-file"
30-
options:
31-
max-file: "5"
32-
max-size: "100m"
33-
container_name: 'jenkins'
34-
privileged: true
35-
volumes:
36-
- './jenkins_home:/var/jenkins_home'
37-
expose:
38-
- "8080"
39-
environment:
40-
TZ: "Asia/Seoul"
41-
restart: always
3+
nginx-proxy:
4+
image: nginx:latest
5+
logging:
6+
driver: "${LOG_DRIVER}"
7+
options:
8+
max-file: "${LOG_OPT_MAXF}"
9+
max-size: "${LOG_OPT_MAXS}"
10+
container_name: nginx-proxy
11+
volumes:
12+
- ../../../config/web-server/nginx/php/conf.d/:/etc/nginx/conf.d/
13+
- ../../../config/web-server/nginx/php/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
14+
- ../../../config/web-server/nginx/php/fastcgi/fastcgi_params:/etc/nginx/fastcgi_params
15+
- ../../../ssl:/etc/nginx/ssl/
16+
- ../../../log/nginx/:/log/nginx/
17+
ports:
18+
- "80:80"
19+
- "443:443"
20+
environment:
21+
TZ: "Asia/Seoul"
22+
restart: always
23+
depends_on:
24+
- jenkins
25+
26+
jenkins:
27+
image: "jenkins/jenkins:latest"
28+
logging:
29+
driver: "${LOG_DRIVER}"
30+
options:
31+
max-file: "${LOG_OPT_MAXF}"
32+
max-size: "${LOG_OPT_MAXS}"
33+
container_name: "jenkins"
34+
privileged: true
35+
volumes:
36+
- "./jenkins_home:/var/jenkins_home"
37+
expose:
38+
- "8080"
39+
environment:
40+
TZ: "Asia/Seoul"
41+
restart: always
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
LOG_DRIVER=json-file
2+
LOG_OPT_MAXF=5
3+
LOG_OPT_MAXS=100m
4+
EMAIL_DELIVERY_METHOD=smtp
5+
SMTP_ADDRESS=smtp.mailgun.org
6+
SMTP_PORT=587
7+
SMTP_DOMAIN=domain
8+
SMTP_AUTHENTICATION=login
9+
SMTP_ENABLE_STARTTLS_AUTO=true
10+
SMTP_USER_NAME=id
11+
SMTP_PASSWORD=api_key
12+
PASSENGER_START_TIMEOUT=3000

compose/project_mng_service/nginx_openproject/docker-compose.yml

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ services:
33
nginx-proxy:
44
image: nginx:latest
55
logging:
6-
driver: "json-file"
6+
driver: "${LOG_DRIVER}"
77
options:
8-
max-file: "5"
9-
max-size: "100m"
8+
max-file: "${LOG_OPT_MAXF}"
9+
max-size: "${LOG_OPT_MAXS}"
1010
container_name: nginx-proxy
1111
volumes:
1212
- ../../../config/web-server/nginx/php/conf.d/:/etc/nginx/conf.d/
@@ -22,34 +22,31 @@ services:
2222
restart: always
2323
depends_on:
2424
- openproject
25-
25+
2626
openproject:
2727
image: openproject/community:11
2828
logging:
29-
driver: "json-file"
29+
driver: "${LOG_DRIVER}"
3030
options:
31-
max-file: "5"
32-
max-size: "100m"
31+
max-file: "${LOG_OPT_MAXF}"
32+
max-size: "${LOG_OPT_MAXS}"
3333
container_name: openproject
3434
privileged: true
35-
environment:
36-
EMAIL_DELIVERY_METHOD: smtp
37-
SMTP_ADDRESS: smtp.mailgun.org
38-
SMTP_PORT: 587
39-
SMTP_DOMAIN: "domain"
40-
SMTP_AUTHENTICATION: login
41-
SMTP_ENABLE_STARTTLS_AUTO: "true"
42-
SMTP_USER_NAME: "id"
43-
SMTP_PASSWORD: "api key"
4435
volumes:
4536
- ./pgdata/:/var/openproject/pgdata/
4637
- ../../../log/supervisor/:/var/log/supervisor/
4738
- ./static/:/var/openproject/assets/
4839
expose:
4940
- "8080"
5041
environment:
42+
EMAIL_DELIVERY_METHOD: ${EMAIL_DELIVERY_METHOD}
43+
SMTP_ADDRESS: ${SMTP_ADDRESS}
44+
SMTP_PORT: ${SMTP_PORT}
45+
SMTP_DOMAIN: "${SMTP_DOMAIN}"
46+
SMTP_AUTHENTICATION: ${SMTP_AUTHENTICATION}
47+
SMTP_ENABLE_STARTTLS_AUTO: "${SMTP_ENABLE_STARTTLS_AUTO}"
48+
SMTP_USER_NAME: "${SMTP_USER_NAME}"
49+
SMTP_PASSWORD: "${SMTP_PASSWORD}"
5150
TZ: "Asia/Seoul"
52-
PASSENGER_START_TIMEOUT: 3000
51+
PASSENGER_START_TIMEOUT: ${PASSENGER_START_TIMEOUT}
5352
restart: always
54-
55-
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
PROJECT_DIR=django_sample
2+
WORKERS=4
3+
GUNICORN_PORT=8000
4+
PROJECT_NAME=django_sample
5+
GUNICORN_OPITON=--reload
6+
LOG_DRIVER=json-file
7+
LOG_OPT_MAXF=5
8+
LOG_OPT_MAXS=100m
9+
MYSQL_ROOT_PASSWORD=test1324

0 commit comments

Comments
 (0)