From 6edb7b3af55d546706afae6de8cb2a97c3c3a9d8 Mon Sep 17 00:00:00 2001 From: mike12345567 Date: Wed, 16 Dec 2020 16:02:36 +0000 Subject: [PATCH] Some minor changes to get nginx up and running in front of minio correctly. --- hosting/docker-compose.yml | 20 ++++++++++++-------- hosting/hosting.properties | 3 +++ hosting/nginx.conf | 11 +++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/hosting/docker-compose.yml b/hosting/docker-compose.yml index 72a055e91a..3ddca25c26 100644 --- a/hosting/docker-compose.yml +++ b/hosting/docker-compose.yml @@ -6,15 +6,16 @@ services: volumes: - ./server:/app ports: - - "4001:4001" + - "${APP_PORT}:${APP_PORT}" environment: MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} - MINIO_URL: http://minio-service:9000 + MINIO_URL: http://nginx-service:${MINIO_PORT} SELF_HOSTED: 1 COUCH_DB_URL: http://${COUCH_DB_USER}:${COUCH_DB_PASSWORD}@couchdb-service:5984 BUDIBASE_ENVIRONMENT: ${BUDIBASE_ENVIRONMENT} LOGO_URL: ${LOGO_URL} + PORT: ${APP_PORT} depends_on: - nginx-service - minio-service @@ -24,8 +25,8 @@ services: image: minio/minio:RELEASE.2020-12-10T01-54-29Z volumes: - data1:/data - expose: - - "9000" + ports: + - "9000:9000" environment: MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY} MINIO_SECRET_KEY: ${MINIO_SECRET_KEY} @@ -39,11 +40,12 @@ services: nginx-service: image: nginx:1.19.2-alpine volumes: - - ./nginx.conf:/etc/nginx/nginx.conf:ro + - ./nginx.template:/etc/nginx/nginx.template:ro ports: - - "9000:9000" + - "${MINIO_PORT}:5001" depends_on: - minio-service + command: ["sh", "-c", "envsubst < /etc/nginx/nginx.template > /etc/nginx/nginx.conf && nginx -g 'daemon off;'"] couchdb-service: image: apache/couchdb:3.0 @@ -51,7 +53,7 @@ services: - COUCHDB_PASSWORD=${COUCH_DB_PASSWORD} - COUCHDB_USER=${COUCH_DB_USER} ports: - - "5984:5984" + - "${COUCH_DB_PORT}:5984" - "4369:4369" - "9100:9100" volumes: @@ -59,9 +61,11 @@ services: couch-init: image: curlimages/curl + environment: + PUT_CALL: "curl -u ${COUCH_DB_USER}:${COUCH_DB_PASSWORD} -X PUT couchdb-service:5984" depends_on: - couchdb-service - command: ["sh","-c","sleep 10 && curl -u ${COUCH_DB_USER}:${COUCH_DB_PASSWORD} -X PUT couchdb-service:5984/_users && curl -u ${COUCH_DB_USER}:${COUCH_DB_PASSWORD} -X PUT couchdb-service:5984/_replicator; fg ; "] + command: ["sh","-c","sleep 10 && $${PUT_CALL}/_users && $${PUT_CALL}/_replicator; fg;"] volumes: couchdb_data: diff --git a/hosting/hosting.properties b/hosting/hosting.properties index 9e4dfe1dfc..3334b88f42 100644 --- a/hosting/hosting.properties +++ b/hosting/hosting.properties @@ -5,3 +5,6 @@ COUCH_DB_USER=budibase BUDIBASE_ENVIRONMENT=PRODUCTION HOSTING_URL="http://localhost:4001" LOGO_URL=https://logoipsum.com/logo/logo-15.svg +APP_PORT=4002 +MINIO_PORT=4003 +COUCH_DB_PORT=4004 diff --git a/hosting/nginx.conf b/hosting/nginx.conf index 9ca4f1d630..4782d7a0b1 100644 --- a/hosting/nginx.conf +++ b/hosting/nginx.conf @@ -31,19 +31,18 @@ http { # include /etc/nginx/conf.d/*.conf; upstream minio { - server minio:9000; + # if adding more minio services to cluster add them here + server minio-service:9000; } server { - listen 9000; - listen [::]:9000; + listen 5001; + listen [::]:5001; server_name localhost; # To allow special characters in headers ignore_invalid_headers off; - # Allow any size file to be uploaded. - # Set to a value such as 1000m; to restrict file size to a specific value - client_max_body_size 0; + client_max_body_size 100m; # To disable buffering proxy_buffering off;