gunicorn 명령어 기반 uvicorn 실행시 사용되는 설정파일 추가, logrotate 설정 추가.
This commit is contained in:
1 parent
628b22dd03
commit
94b5633065
29 files changed
+4979
No files matched your search
@@ -0,0 +1,11 @@
|
||||
PROJECT_DIR=django_sample
|
||||
WORKERS=4
|
||||
GUNICORN_PORT=8000
|
||||
REQUIREMENTS=./requirements.txt
|
||||
PROJECT_NAME=django_sample
|
||||
LOG_DRIVER=json-file
|
||||
LOG_OPT_MAXF=5
|
||||
LOG_OPT_MAXS=100m
|
||||
CELERY_BROKER_URL=redis://redis:6379/3
|
||||
FLOWER_ID=admin
|
||||
FLOWER_PWD=admin
|
||||
@@ -0,0 +1,158 @@
|
||||
services:
|
||||
webserver:
|
||||
build: ../../../docker/nginx/
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
working_dir: /application
|
||||
container_name: nginx-uvicorn-webserver
|
||||
volumes:
|
||||
- ../../../www:/www
|
||||
- ../../../script/:/script/
|
||||
- ../../../config/web-server/nginx/gunicorn/conf.d/:/etc/nginx/conf.d/
|
||||
- ../../../config/web-server/nginx/gunicorn/nginx_conf/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ../../../config/web-server/nginx/gunicorn/proxy_params/proxy_params:/etc/nginx/proxy_params
|
||||
- ./ssl/certs/:/etc/ssl/certs/
|
||||
- ./ssl/letsencrypt/:/etc/letsencrypt/
|
||||
- ../../../log/:/log/
|
||||
- ../../../script/logrotate/nginx/nginx:/etc/logrotate.d/nginx
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
restart: always
|
||||
|
||||
uvicorn-app:
|
||||
build: ../../../docker/gunicorn/
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
working_dir: /www/${PROJECT_DIR}
|
||||
container_name: uvicorn-app
|
||||
volumes:
|
||||
- ../../../www:/www
|
||||
- ../../../log:/log
|
||||
- ../../../config/app-server/uvicorn/:/uvicorn
|
||||
- ../../../script/logrotate/uvicorn/uvicorn:/etc/logrotate.d/uvicorn
|
||||
command: bash -c "poetry config virtualenvs.create false && poetry install --no-root --without test && gunicorn -c /uvicorn/gunicorn_uvicorn.conf.py"
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
restart: always
|
||||
|
||||
celery:
|
||||
build: ../../../docker/gunicorn/
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
working_dir: /www/${PROJECT_DIR}
|
||||
container_name: celery-app
|
||||
volumes:
|
||||
- ../../../www:/www
|
||||
- ../../../log:/log
|
||||
- ../../../script/logrotate/uvicorn/celery/uvicorn-celery:/etc/logrotate.d/uvicorn-celery
|
||||
command: bash -c "poetry config virtualenvs.create false && \
|
||||
poetry install --no-root && \
|
||||
celery -A config worker \
|
||||
--loglevel=INFO \
|
||||
--logfile=/log/uvicorn/celery/worker-%n%I.log "
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
restart: always
|
||||
depends_on:
|
||||
- redis
|
||||
- gunicorn-uvicorn-app
|
||||
profiles:
|
||||
- celery
|
||||
|
||||
celery-beat:
|
||||
build: ../../../docker/gunicorn/
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
working_dir: /www/${PROJECT_DIR}
|
||||
container_name: celerybeat-app
|
||||
volumes:
|
||||
- ../../../www:/www
|
||||
- ../../../log:/log
|
||||
- ../../../script/logrotate/uvicorn/celerybeat/uvicorn-celerybeat:/etc/logrotate.d/uvicorn-celerybeat
|
||||
command: bash -c "poetry config virtualenvs.create false && \
|
||||
poetry install --no-root && \
|
||||
celery -A config beat \
|
||||
--loglevel=INFO \
|
||||
--scheduler django_celery_beat.schedulers:DatabaseScheduler \
|
||||
--logfile=/log/uvicorn/celerybeat/celerybeat.log "
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
restart: always
|
||||
depends_on:
|
||||
- celery
|
||||
profiles:
|
||||
- celery
|
||||
|
||||
flower:
|
||||
image: mher/flower:master
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
container_name: flower
|
||||
ports:
|
||||
- "5555:5555"
|
||||
environment:
|
||||
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
|
||||
- FLOWER_BASIC_AUTH=${FLOWER_ID}:${FLOWER_PWD}
|
||||
restart: always
|
||||
depends_on:
|
||||
- celery-beat
|
||||
profiles:
|
||||
- celery
|
||||
|
||||
redis:
|
||||
image: redis:latest
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
container_name: redis_db
|
||||
# ports:
|
||||
# - 6379:6379
|
||||
volumes:
|
||||
- ./redis/data:/data
|
||||
- ./redis/conf/:/usr/local/etc/redis/
|
||||
labels:
|
||||
- "name=redis"
|
||||
- "mode=standalone"
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
restart: always
|
||||
command: redis-server /usr/local/etc/redis/redis.conf
|
||||
|
||||
redis-stats:
|
||||
image: insready/redis-stat:latest
|
||||
logging:
|
||||
driver: "${LOG_DRIVER}"
|
||||
options:
|
||||
max-file: "${LOG_OPT_MAXF}"
|
||||
max-size: "${LOG_OPT_MAXS}"
|
||||
container_name: redis-stats
|
||||
ports:
|
||||
- 63790:63790
|
||||
command: ["--verbose", "--server", "redis:6379"]
|
||||
environment:
|
||||
TZ: "Asia/Seoul"
|
||||
depends_on:
|
||||
- redis
|
||||
restart: always
|
||||
profiles:
|
||||
- redis
|
||||
File diff suppressed because it is too large.
Load diff
Whitespace-only changes.
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
Reference in new issue
Block a user