From 9308ecfe8d205303691b15b185001143de899b22 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Sun, 25 Feb 2024 18:40:02 +0000 Subject: [PATCH] fix: temporarily bundle minio in prod until minio instance profile --- docker-compose.main.yml | 30 ++++++++++++++++++++++++++++++ nginx/Dockerfile | 8 ++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/docker-compose.main.yml b/docker-compose.main.yml index 85cb523f45..8c823c3d6e 100644 --- a/docker-compose.main.yml +++ b/docker-compose.main.yml @@ -24,6 +24,8 @@ volumes: name: fmtm-frontend-main fmtm_db_data: name: fmtm-db-data-main + fmtm_data: + name: fmtm-s3-data-main fmtm_logs: name: fmtm-logs-main fmtm_images: @@ -47,6 +49,8 @@ services: condition: service_started certbot: condition: service_completed_successfully + s3: + condition: service_started ui: condition: service_completed_successfully volumes: @@ -56,6 +60,7 @@ services: environment: FMTM_DOMAIN: ${FMTM_DOMAIN} FMTM_API_DOMAIN: ${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}} + FMTM_S3_DOMAIN: ${FMTM_S3_DOMAIN:-s3.${FMTM_DOMAIN}} ports: - 80:80 - 443:443 @@ -73,6 +78,8 @@ services: condition: service_healthy migrations: condition: service_completed_successfully + s3: + condition: service_healthy env_file: - .env networks: @@ -103,6 +110,26 @@ services: network_mode: none restart: "on-failure:2" + s3: + image: "docker.io/minio/minio:${MINIO_TAG:-RELEASE.2024-01-01T16-36-33Z}" + environment: + MINIO_ROOT_USER: ${S3_ACCESS_KEY} + MINIO_ROOT_PASSWORD: ${S3_SECRET_KEY} + MINIO_VOLUMES: "/mnt/data" + MINIO_BROWSER: "off" + volumes: + - fmtm_data:/mnt/data + networks: + - fmtm-net + command: minio server + restart: "unless-stopped" + healthcheck: + test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1 + interval: 5s + retries: 3 + start_period: 5s + timeout: 5s + fmtm-db: image: "postgis/postgis:${POSTGIS_TAG:-14-3.4-alpine}" volumes: @@ -128,6 +155,8 @@ services: depends_on: fmtm-db: condition: service_healthy + s3: + condition: service_healthy env_file: - .env networks: @@ -161,6 +190,7 @@ services: environment: FMTM_DOMAIN: ${FMTM_DOMAIN} FMTM_API_DOMAIN: ${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}} + FMTM_S3_DOMAIN: ${FMTM_S3_DOMAIN:-s3.${FMTM_DOMAIN}} CERT_EMAIL: ${CERT_EMAIL} ports: - 80:80 diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 83b71b92f9..3998bb5042 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -102,27 +102,27 @@ COPY container-entrypoint.sh /docker-entrypoint.sh RUN chmod +x /docker-entrypoint.sh COPY templates/cert-init/fmtm.conf.template \ templates/cert-init/api.conf.template \ + templates/cert-init/minio.conf.template \ /etc/nginx/templates/ FROM certs-init-main as certs-init-development COPY templates/cert-init/odk.conf.template \ - templates/cert-init/minio.conf.template \ /etc/nginx/templates/ FROM base as main -# API & Frontend only +# API, Frontend, S3 COPY templates/fmtm.conf.template \ templates/api.conf.template \ + templates/minio.conf.template \ /etc/nginx/templates/ FROM main as development -# API, Frontend, ODK, S3 +# API, Frontend, S3 + ODK COPY templates/odk.conf.template \ - templates/minio.conf.template \ /etc/nginx/templates/