zappyzep/docker-compose.standalone.yml
Dragory 509d96ce83
refactor: new dev/prod containers
- Use a single Dockerfile for all Zeppelin services
- Add a Dockerfile in project root that can be used by
  app hosting services
- Provide a standalone and lightweight prod setup
  - Standalone is the same as the old setup, with mysql+nginx
  - Lightweight only runs bot+backend+dash, no mysql/nginx
- Remove mounted mysql data folders for dev and prod
  - This resolves permission issues caused by the mount
  - The mysql service uses a regular named volume now
- Simplify .env options and clearly separate different prod setups
- Remove update.sh
  - Different setups require different update procedures, so a common
    update.sh no longer works
2024-03-17 18:49:31 +02:00

84 lines
2.3 KiB
YAML

version: '3'
name: zeppelin-prod
volumes:
mysql-data:
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: ${STANDALONE_MYSQL_ROOT_PASSWORD?:Missing STANDALONE_MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: zeppelin
MYSQL_USER: zeppelin
MYSQL_PASSWORD: ${STANDALONE_MYSQL_PASSWORD?:Missing STANDALONE_MYSQL_PASSWORD}
ports:
- 127.0.0.1:${STANDALONE_MYSQL_PORT:?Missing STANDALONE_MYSQL_PORT}:3306
# If you're upgrading from an older version, you can load your old database by switching the volumes below.
# Then, take a database dump from the old database, switch the volumes back, and load the dump into the new database.
volumes:
- mysql-data:/var/lib/mysql
# - ./docker/production/data/mysql:/var/lib/mysql
command: --authentication-policy=mysql_native_password
healthcheck:
test: "/usr/bin/mysql --user=root --password=\"${STANDALONE_MYSQL_ROOT_PASSWORD}\" --execute \"SHOW DATABASES;\""
interval: 5s
timeout: 300s
retries: 60
nginx:
build:
context: .
dockerfile: docker/production/nginx/Dockerfile
args:
STANDALONE_DOMAIN: ${STANDALONE_DOMAIN:?Missing STANDALONE_DOMAIN}
ports:
- "${STANDALONE_WEB_PORT:?Missing STANDALONE_WEB_PORT}:443"
migrate:
depends_on:
mysql:
condition: service_healthy
build:
context: .
environment:
HOST_MODE: standalone
working_dir: /zeppelin
command: ["npm", "run", "migrate-prod"]
api:
depends_on:
migrate:
condition: service_completed_successfully
build:
context: .
restart: on-failure
environment:
HOST_MODE: standalone
DEBUG: ${DEBUG-}
working_dir: /zeppelin/backend
command: ["npm", "run", "start-api-prod"]
bot:
depends_on:
migrate:
condition: service_completed_successfully
build:
context: .
restart: on-failure
environment:
HOST_MODE: standalone
DEBUG: ${DEBUG-}
working_dir: /zeppelin/backend
command: ["npm", "run", "start-bot-prod"]
dashboard:
depends_on:
migrate:
condition: service_completed_successfully
build:
context: .
restart: on-failure
environment:
HOST_MODE: standalone
DEBUG: ${DEBUG-}
working_dir: /zeppelin/dashboard
command: ["node", "serve.js"]