Skip to content

Commit

Permalink
build: all img versions dynamic, odkcentral build version dynamic
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed May 29, 2023
1 parent 7926c8a commit 5260376
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
35 changes: 19 additions & 16 deletions docker-compose.deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ volumes:
traefik-public-certificates:

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

services:
traefik:
Expand All @@ -36,7 +37,7 @@ services:
- 80:80
- 443:443
networks:
- fmtm-prod
- fmtm-net
restart: unless-stopped
command:
- "--entrypoints.web.address=:80"
Expand All @@ -51,7 +52,7 @@ services:
# - "--certificatesresolvers.letsencrypt.acme.caserver=https://acme-staging-v02.api.letsencrypt.org/directory"
labels:
- "traefik.enable=true"
- "traefik.docker.network=fmtm_fmtm-prod"
- "traefik.docker.network=fmtm-${GIT_BRANCH}"
- "traefik.api.dashboard=false"
- "traefik.http.middlewares.https_redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https_redirect.redirectscheme.permanent=true"
Expand All @@ -71,11 +72,11 @@ services:
ports:
- "5432:5432"
networks:
- fmtm-prod
- fmtm-net
restart: unless-stopped

api:
image: "ghcr.io/hotosm/fmtm/backend:0.1.0-main"
image: "ghcr.io/hotosm/fmtm/backend:0.1.0-${GIT_BRANCH}"
build:
context: src/backend
target: prod
Expand All @@ -87,7 +88,7 @@ services:
env_file:
- .env
networks:
- fmtm-prod
- fmtm-net
restart: unless-stopped
labels:
- "traefik.enable=true"
Expand All @@ -100,15 +101,15 @@ services:
- "traefik.http.routers.api.service=api-svc"

ui-main:
image: "ghcr.io/hotosm/fmtm/frontend/main:0.1.0-main"
image: "ghcr.io/hotosm/fmtm/frontend/main:0.1.0-${GIT_BRANCH}"
build:
context: src/frontend/main
container_name: fmtm_main
depends_on:
- api
- traefik
networks:
- fmtm-prod
- fmtm-net
environment:
- BROTLI=true
restart: unless-stopped
Expand All @@ -123,15 +124,15 @@ services:
- "traefik.http.routers.ui-main.service=ui-main-svc"

ui-map:
image: "ghcr.io/hotosm/fmtm/frontend/map:0.1.0-main"
image: "ghcr.io/hotosm/fmtm/frontend/map:0.1.0-${GIT_BRANCH}"
build:
context: src/frontend/fmtm_openlayer_map
container_name: fmtm_map
depends_on:
- api
- traefik
networks:
- fmtm-prod
- fmtm-net
environment:
- BROTLI=true
restart: unless-stopped
Expand All @@ -155,13 +156,15 @@ services:
- POSTGRES_PASSWORD=${CENTRAL_DB_PASSWORD:-odk}
- POSTGRES_DB=${CENTRAL_DB_NAME:-odk}
networks:
- fmtm-prod
- fmtm-net
restart: unless-stopped

central:
image: "ghcr.io/hotosm/fmtm/odkcentral:v2023.2.1"
image: "ghcr.io/hotosm/fmtm/odkcentral:${ODK_CENTRAL_VERSION}-${GIT_BRANCH}"
build:
context: odkcentral/api
args:
ODK_CENTRAL_VERSION: ${ODK_CENTRAL_VERSION}
container_name: central_api
depends_on:
- central-db
Expand All @@ -186,7 +189,7 @@ services:
- SENTRY_KEY=${SENTRY_KEY:-3cf75f54983e473da6bd07daddf0d2ee}
- SENTRY_PROJECT=${SENTRY_PROJECT:-1298632}
networks:
- fmtm-prod
- fmtm-net
command:
[
"./wait-for-it.sh",
Expand All @@ -197,19 +200,19 @@ services:
restart: unless-stopped

central-proxy:
image: "ghcr.io/hotosm/fmtm/odkcentral-proxy:0.1.0-main"
image: "ghcr.io/hotosm/fmtm/odkcentral-proxy:0.1.0-${GIT_BRANCH}"
build:
context: odkcentral/proxy
container_name: central_proxy
depends_on:
- central
networks:
- fmtm-prod
- fmtm-net
restart: unless-stopped

pyxform:
image: "ghcr.io/getodk/pyxform-http:v1.10.1.1"
container_name: central_pyxform
networks:
- fmtm-prod
- fmtm-net
restart: always
2 changes: 1 addition & 1 deletion odkcentral/api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends \
"jq" \
&& rm -rf /var/lib/apt/lists/*
ARG ODK_CENTRAL_VERSION=v2023.2.1
ARG ODK_CENTRAL_VERSION=${ODK_CENTRAL_VERSION}
RUN git clone --depth 1 --branch ${ODK_CENTRAL_VERSION} \
"https://github.com/getodk/central.git" \
&& cd central && git submodule update --init
Expand Down

0 comments on commit 5260376

Please sign in to comment.