4 Star 59 Fork 19

花菜/AnotherFasterRunner

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
docker-compose-build-web.yml 3.08 KB
一键复制 编辑 原始数据 按行查看 历史
version: '3.8'
services:
db:
#image: mysql:8.0.21
image: mariadb:10.6.1
# privileged: true
environment:
# 设置默认数据库和root默认密码,如果宿主机中/var/lib/mysql已经存在,这两个设置都不会生效
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
volumes:
# - "/var/lib/mysql:/var/lib/mysql" # 挂载宿主机的mysql数据到docker中
- ./db/my.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- ./db:/docker-entrypoint-initdb.d/:ro
# 端口映射,格式 宿主机端口:容器端口
ports:
- "${MYSQL_PORT_OUT}:3306"
restart: always
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
app:
image: fasterrunner_app:latest
build:
context: .
dockerfile: Dockerfile
environment:
# - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- MQ_PORT=${MQ_PORT}
- SENTRY_DSN=${SENTRY_DSN}
entrypoint: /app/start.sh
command: "app"
depends_on:
- db
restart: always
celery-worker:
build:
context: .
dockerfile: Dockerfile
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- MQ_PORT=${MQ_PORT}
- SERVER_IP=${SERVER_IP}
- DJANGO_API_PORT=${DJANGO_API_PORT}
entrypoint: /app/start.sh
command: "celery-worker"
restart: always
depends_on:
- db
- mq
celery-beat:
build:
context: .
dockerfile: Dockerfile
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- MQ_PORT=${MQ_PORT}
entrypoint: /app/start.sh
command: "celery-beat"
restart: always
depends_on:
- mq
- db
# django-admin & app proxy
nginx:
build: ./nginx
ports:
- "${DJANGO_ADMIN_PORT}:8000"
depends_on:
- app
restart: always
environment:
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
web:
build:
context: ./web
dockerfile: Dockerfile-build
args:
- API_URL=http://${SERVER_IP}:${DJANGO_ADMIN_PORT}
ports:
- "${WEB_PORT}:80"
depends_on:
- app
mq:
image: rabbitmq:management-alpine
environment:
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
- MYSQL_DATABASE=${MYSQL_DATABASE}
restart: always
ports:
- "${MQ_ADMIN_PORT}:15672"
- "${MQ_PORT}:5672"
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lihuacai/AnotherFasterRunner.git
git@gitee.com:lihuacai/AnotherFasterRunner.git
lihuacai
AnotherFasterRunner
AnotherFasterRunner
master

搜索帮助