3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-25 18:25:03 +00:00
zeppelin/docker-compose.production.yml
2023-01-01 17:36:59 -05:00

133 lines
3.9 KiB
YAML

version: '3'
name: zeppelin-prod
services:
nginx:
build:
context: ./docker/production/nginx
args:
API_PORT: ${API_PORT:?Missing API_PORT}
DOCKER_PROD_DOMAIN: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
expose:
#- "${DOCKER_PROD_WEB_PORT:?Missing DOCKER_PROD_WEB_PORT}:443"
#- "${DOCKER_PROD_WEB_PORT:?Missing DOCKER_PROD_WEB_PORT}:80"
- "80"
environment:
VIRTUAL_HOST: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
VIRTUAL_PATH: /
LETSENCRYPT_HOST: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
LETSENCRYPT_EMAIL: $LETSENCRYPT_EMAIL
DEBUG: true
volumes:
- ./:/zeppelin
networks:
- network
- nginx-proxy
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${DOCKER_PROD_MYSQL_ROOT_PASSWORD?:Missing DOCKER_PROD_MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: zeppelin
MYSQL_USER: zeppelin
MYSQL_PASSWORD: ${DOCKER_PROD_MYSQL_PASSWORD?:Missing DOCKER_PROD_MYSQL_PASSWORD}
ports:
- ${DOCKER_PROD_MYSQL_PORT:?Missing DOCKER_PROD_MYSQL_PORT}:3306
volumes:
- ./docker/production/data/mysql:/var/lib/mysql
command: --authentication-policy=mysql_native_password
networks:
- network
healthcheck:
test: "/usr/bin/mysql --user=root --password=\"${DOCKER_PROD_MYSQL_ROOT_PASSWORD}\" --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 300s
retries: 60
phpmyadmin:
depends_on:
- mysql
image: phpmyadmin:latest
restart: unless-stopped
expose:
- "80"
#- "443"
environment:
PMA_HOST: mysql
PMA_ABSOLUTE_URI: https://${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}/phpmyadmin/
MYSQL_ROOT_PASSWORD: ${DOCKER_PROD_MYSQL_ROOT_PASSWORD?:Missing DOCKER_PROD_MYSQL_ROOT_PASSWORD}
MYSQL_USER: zeppelin
MYSQL_PASSWORD: ${DOCKER_PROD_MYSQL_PASSWORD?:Missing DOCKER_PROD_MYSQL_PASSWORD}
VIRTUAL_HOST: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
VIRTUAL_PATH: /phpmyadmin
VIRTUAL_DEST: /
LETSENCRYPT_HOST: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
LETSENCRYPT_EMAIL: $LETSENCRYPT_EMAIL
DEBUG: ${DEBUG:-false}
networks:
- network
- nginx-proxy
prepare_backend:
build:
context: ./docker/production/node
args:
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
depends_on:
mysql:
condition: service_healthy
volumes:
- ./:/zeppelin
networks:
- network
command: |-
bash -c "cd /zeppelin/backend && npm ci && npm run build && npm run migrate-prod"
api:
build:
context: ./docker/production/node
args:
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
restart: on-failure
depends_on:
- prepare_backend
volumes:
- ./:/zeppelin
networks:
- network
command: ["/bin/bash", "/zeppelin/docker/production/start-api.sh"]
bot:
build:
context: ./docker/production/node
args:
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
restart: on-failure
depends_on:
- prepare_backend
volumes:
- ./:/zeppelin
networks:
- network
command: ["/bin/bash", "/zeppelin/docker/production/start-bot.sh"]
build_dashboard:
build:
context: ./docker/production/node
args:
DOCKER_USER_UID: ${DOCKER_USER_UID:?Missing DOCKER_USER_UID}
DOCKER_USER_GID: ${DOCKER_USER_GID:?Missing DOCKER_USER_GID}
volumes:
- ./:/zeppelin
networks:
- network
command: |-
bash -c "cd /zeppelin/dashboard && npm ci && npm run build"
networks:
network:
nginx-proxy:
name: nginx-proxy
external: true