zappyzep/docker-compose.production.yml
Dragory b67b3c35b7
build: refactor production containers
Production containers now copy the Zeppelin source files at
build-time rather than using a shared volume. This means fewer
permission issues and backend/dashboard builds only have to run once
at build-time, not every time the containers are started.

Docs in PRODUCTION.md have been updated accordingly.
2023-07-01 10:33:35 +00:00

62 lines
1.8 KiB
YAML

version: '3'
name: zeppelin-prod
services:
nginx:
build:
context: .
dockerfile: docker/production/nginx/Dockerfile
args:
API_PORT: ${API_PORT:?Missing API_PORT}
DOCKER_PROD_DOMAIN: ${DOCKER_PROD_DOMAIN:?Missing DOCKER_PROD_DOMAIN}
ports:
- "${DOCKER_PROD_WEB_PORT:?Missing DOCKER_PROD_WEB_PORT}:443"
volumes:
- ./:/zeppelin
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
healthcheck:
test: "/usr/bin/mysql --user=root --password=\"${DOCKER_PROD_MYSQL_ROOT_PASSWORD}\" --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 300s
retries: 60
migrate:
build:
context: .
dockerfile: docker/production/backend/Dockerfile
command: ["npm", "run", "migrate-prod"]
api:
depends_on:
migrate:
condition: service_completed_successfully
build:
context: .
dockerfile: docker/production/backend/Dockerfile
restart: on-failure
environment:
DEBUG: ${DEBUG-}
command: ["npm", "run", "start-api-prod"]
bot:
depends_on:
migrate:
condition: service_completed_successfully
build:
context: .
dockerfile: docker/production/backend/Dockerfile
restart: on-failure
environment:
DEBUG: ${DEBUG-}
command: ["/bin/bash", "/zeppelin/docker/production/start-bot.sh"]