From 2ceee13a1f0043fddc180fd519cefe4f0f229f76 Mon Sep 17 00:00:00 2001 From: David Wang Date: Tue, 17 Jan 2023 15:52:27 -0800 Subject: [PATCH] Unbound mysql port to host; made project name an env variable --- .env.example | 14 ++++++++++++-- docker-compose.production.yml | 9 ++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index d4f9db8d..db1351e3 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,11 @@ +#Project Name +#Critical when running multiple Zeppelin instances on the same computer. +#Must be unique across all project names/folders. +#Use a meaningful name so that you remember what it's for 1 year down the line. +#If runnning only one Zeppelin instance, or this is your first one, you may leave this blank. +#Defaults to "zeppelin_prod" if left blank. +PROJECT_NAME= + # 32 character encryption key KEY= @@ -60,7 +68,9 @@ DOCKER_PROD_DOMAIN= DOCKER_PROD_WEB_PORT=443 # The MySQL database running in the container is exposed to the host on this port, # allowing access with database tools such as DBeaver -DOCKER_PROD_MYSQL_PORT=3001 +# Defaults to 3306 if left blank. +# If you need to access your database from host/outside, follow the instructions in docker-compose.production.yml as well. +DOCKER_PROD_MYSQL_PORT= # Password for the Zeppelin database user DOCKER_PROD_MYSQL_PASSWORD= # Password for the MySQL root user @@ -75,4 +85,4 @@ DOCKER_PROD_MYSQL_ROOT_PASSWORD= #nginx-proxy related LETSENCRYPT_EMAIL= -DEBUG= \ No newline at end of file +DEBUG= diff --git a/docker-compose.production.yml b/docker-compose.production.yml index 7bcda7d9..5847ca48 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -1,5 +1,5 @@ version: '3' -name: zeppelin-prod +name: ${PROJECT_NAME:-zeppelin-prod} services: nginx: build: @@ -30,8 +30,11 @@ services: 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 + expose: + - 3306 + #Comment the expose section above AND uncomment the ports section below if the database needs to be accessible from host computer or from outside. + #ports: + # - ${DOCKER_PROD_MYSQL_PORT:-3306}:3306 volumes: - ./docker/production/data/mysql:/var/lib/mysql command: --authentication-policy=mysql_native_password