From 366aa03a0ea24b9ef21e8a89431baca57f60dd56 Mon Sep 17 00:00:00 2001 From: Kalitsune Date: Wed, 4 Sep 2024 13:15:35 +0200 Subject: [PATCH] feat: modernized the docker-compose file (#776) This commit allows the port to be controlled using environment variables without having to edit the file which can be troublesome as this app is deployed as a git repo. Additionaly this commits removes the `version` field which is now deprecated (read: https://docs.docker.com/reference/compose-file/version-and-name/#version-top-level-element-obsolete) --- deploy.env | 5 +++++ docker-compose-ci.yml | 5 ++--- docker-compose-dev.yml | 1 - docker-compose-extras.yml | 1 - docker-compose.yml | 5 ++--- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/deploy.env b/deploy.env index 0853124c..e5302829 100644 --- a/deploy.env +++ b/deploy.env @@ -110,6 +110,11 @@ PORTAINER_PASSWORD=password1234 # Cloudflare tunnel token CLOUDFLARE_TUNNEL_TOKEN= +# NGINX +# Optional, change this if you want to use custom ports to expose AppFlowy +NGINX_PORT=80 +NGINX_TLS_PORT=443 + # If you are using a different postgres database, change the following values # GOTRUE_DATABASE_URL=postgres://supabase_auth_admin:root@:/$POSTGRES_DB # APPFLOWY_DATABASE_URL=postgres://POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST:5432/$POSTGRES_DB diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index dc4afc2b..96c570e1 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -1,13 +1,12 @@ # Essential services for AppFlowy Cloud -version: '3' services: nginx: restart: on-failure image: nginx ports: - - 80:80 # Disable this if you are using TLS - - 443:443 + - ${NGINX_PORT:-80}:80 # Disable this if you are using TLS + - ${NGINX_TLS_PORT:-443}:443 volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/ssl/certificate.crt:/etc/nginx/ssl/certificate.crt diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 97c7fae4..0733600f 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -1,4 +1,3 @@ -version: '3' services: nginx: restart: on-failure diff --git a/docker-compose-extras.yml b/docker-compose-extras.yml index 6b46fe68..275a4a5d 100644 --- a/docker-compose-extras.yml +++ b/docker-compose-extras.yml @@ -1,6 +1,5 @@ # Non-essential additional services -version: '3' services: tunnel: image: cloudflare/cloudflared diff --git a/docker-compose.yml b/docker-compose.yml index ddc75c97..5fb8d001 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,13 +1,12 @@ # Essential services for AppFlowy Cloud -version: '3' services: nginx: restart: on-failure image: nginx ports: - - 80:80 # Disable this if you are using TLS - - 443:443 + - ${NGINX_PORT:-80}:80 # Disable this if you are using TLS + - ${NGINX_TLS_PORT:-443}:443 volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf - ./nginx/ssl/certificate.crt:/etc/nginx/ssl/certificate.crt