Skip to content

Commit

Permalink
build: remove default script domain init (only if var set)
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Nov 10, 2023
1 parent b60ddff commit 9a9c422
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 21 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/build_proxy_imgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ jobs:
extra_build_args: |
NGINX_TAG=${{ vars.NGINX_TAG }}
build-proxy-main-plus-script:
uses: hotosm/gh-workflows/.github/workflows/[email protected]
with:
context: nginx
build_target: main-plus-script
image_tags: |
"ghcr.io/${{ github.repository }}/proxy:main-plus-script"
extra_build_args: |
NGINX_TAG=${{ vars.NGINX_TAG }}
build-proxy-dev:
uses: hotosm/gh-workflows/.github/workflows/[email protected]
with:
Expand Down
40 changes: 20 additions & 20 deletions docker-compose.main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ version: "3"

volumes:
fmtm_frontend:
name: fmtm-frontend-${GIT_BRANCH}
name: fmtm-frontend-main
fmtm_db_data:
name: fmtm-db-data-${GIT_BRANCH}
name: fmtm-db-data-main
fmtm_logs:
name: fmtm-logs-${GIT_BRANCH}
name: fmtm-logs-main
fmtm_images:
name: fmtm-images-${GIT_BRANCH}
name: fmtm-images-main
fmtm_tiles:
name: fmtm-tiles-${GIT_BRANCH}
name: fmtm-tiles-main
certs:
name: fmtm-certs-${GIT_BRANCH}
name: fmtm-certs-main
certbot_data:
name: fmtm-certbot-data-${GIT_BRANCH}
name: fmtm-certbot-data-main

networks:
fmtm-net:
name: fmtm-${GIT_BRANCH}
name: fmtm-main

services:
proxy:
image: "ghcr.io/hotosm/fmtm/proxy:${GIT_BRANCH}"
container_name: fmtm-${GIT_BRANCH}
image: "ghcr.io/hotosm/fmtm/proxy:main${FMTM_SCRIPT_DOMAIN:+-plus-script}"
container_name: fmtm-main
depends_on:
api:
condition: service_started
Expand All @@ -64,8 +64,8 @@ services:
restart: "unless-stopped"

api:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
container_name: fmtm-api-${GIT_BRANCH}
image: "ghcr.io/hotosm/fmtm/backend:main"
container_name: fmtm-api-main
volumes:
- fmtm_logs:/opt/logs
- fmtm_images:/opt/app/images
Expand All @@ -89,17 +89,17 @@ services:
context: src/frontend
dockerfile: prod.dockerfile
args:
APP_VERSION: ${GIT_BRANCH}
APP_VERSION: main
VITE_API_URL: https://${FMTM_API_DOMAIN:-api.${FMTM_DOMAIN}}
container_name: fmtm-ui-${GIT_BRANCH}
container_name: fmtm-ui-main
volumes:
- fmtm_frontend:/frontend
network_mode: none
restart: "on-failure:2"

fmtm-db:
image: "postgis/postgis:${POSTGIS_TAG:-14-3.4-alpine}"
container_name: fmtm-db-${GIT_BRANCH}
container_name: fmtm-db-main
volumes:
- fmtm_db_data:/var/lib/postgresql/data/
environment:
Expand All @@ -119,8 +119,8 @@ services:
retries: 3

migrations:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
container_name: fmtm-migrations-${GIT_BRANCH}
image: "ghcr.io/hotosm/fmtm/backend:main"
container_name: fmtm-migrations-main
depends_on:
fmtm-db:
condition: service_healthy
Expand All @@ -132,8 +132,8 @@ services:
restart: "on-failure:3"

backups:
image: "ghcr.io/hotosm/fmtm/backend:${GIT_BRANCH}"
container_name: fmtm-backups-${GIT_BRANCH}
image: "ghcr.io/hotosm/fmtm/backend:main"
container_name: fmtm-backups-main
depends_on:
fmtm-db:
condition: service_healthy
Expand All @@ -152,7 +152,7 @@ services:

certbot:
image: "ghcr.io/hotosm/fmtm/proxy:certs-init-main"
container_name: fmtm-cert-renew-${GIT_BRANCH}
container_name: fmtm-cert-renew-main
volumes:
- certs:/etc/letsencrypt
- certbot_data:/var/www/certbot
Expand Down
8 changes: 7 additions & 1 deletion nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ FROM base as main
# API & Frontend only
COPY templates/fmtm.conf.template \
templates/api.conf.template \
templates/script.conf.template \
/etc/nginx/templates/



FROM main as main-plus-script
# Add install script
COPY templates/script.conf.template \
/etc/nginx/templates/


Expand Down
11 changes: 11 additions & 0 deletions nginx/build_imgs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,14 @@ docker build nginx \
if [[ -n "$PUSH_IMGS" ]]; then
docker push "ghcr.io/hotosm/fmtm/proxy:main"
fi

# Main plus script proxy
echo "Building proxy:main-plus-script"
docker build nginx \
--tag "ghcr.io/hotosm/fmtm/proxy:main-plus-script" \
--target main-plus-script \
--build-arg NGINX_TAG="${NGINX_TAG:-1.25.2}"

if [[ -n "$PUSH_IMGS" ]]; then
docker push "ghcr.io/hotosm/fmtm/proxy:main-plus-script"
fi

0 comments on commit 9a9c422

Please sign in to comment.