Skip to content

Commit

Permalink
Add configuration for osmit-tm4
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant authored and frafra committed Oct 29, 2023
1 parent f74d1f5 commit 9d48991
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/osmit-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches:
- osm-ita
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@main

- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Set output
id: vars
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: 'Build Backend Image'
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
run: |
docker build . -f ./scripts/docker/Dockerfile.backend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$GITHUB_SHA
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-backend:$RELEASE_VERSION
- name: 'Build Frontend Image'
env:
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
FRONTEND_ENV: ${{ vars.FRONTEND_ENV }}
run: |
echo "$FRONTEND_ENV" > tasking-manager.env
docker build . -f ./scripts/docker/Dockerfile.frontend --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA --tag ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$GITHUB_SHA
docker push ghcr.io/${GITHUB_REPOSITORY_OWNER,,}/osmit-tm-frontend:$RELEASE_VERSION
3 changes: 3 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ services:
<<: *backend
volumes:
- .:/usr/src/app
labels:
- traefik.http.routers.backend.rule=Host(`localhost`) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=5000

# Migration service
migration:
Expand Down
14 changes: 8 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: "3.4"

x-backend-config: &backend
image: hotosm-tasking-manager:backend
image: ghcr.io/osmitalia/osmit-tm-backend:v4.6.2-hotfix
env_file: ${ENV_FILE:-tasking-manager.env}
depends_on:
- postgresql
Expand All @@ -18,7 +18,7 @@ services:
container_name: backend
restart: always
labels:
- traefik.http.routers.backend.rule=(Host(`127.0.0.1`) || Host(`localhost`)) && PathPrefix(`/api/`)
- traefik.http.routers.backend.rule=Host(`osmit-tm4.wmcloud.org`) && PathPrefix(`/api/`)
- traefik.http.services.backend.loadbalancer.server.port=5000

migration:
Expand All @@ -28,21 +28,23 @@ services:
command: flask db upgrade

frontend:
image: hotosm-tasking-manager:frontend
image: ghcr.io/osmitalia/osmit-tm-frontend:v4.6.2-hotfix
restart: always
networks:
- tm-web
labels:
- traefik.http.routers.frontend.rule=Host(`127.0.0.1`) || Host(`localhost`)
- traefik.http.services.frontend.loadbalancer.server.port=3000
- traefik.http.routers.frontend.rule=Host(`osmit-tm4.wmcloud.org`)
- traefik.http.services.frontend.loadbalancer.server.port=80

postgresql:
image: postgis/postgis:14-3.3
image: mdillon/postgis:11
container_name: postgresql
restart: always
env_file: ${ENV_FILE:-tasking-manager.env}
networks:
- tm-web
volumes:
- /srv/postgresql:/var/lib/postgresql/data

traefik:
image: traefik:v2.10
Expand Down

0 comments on commit 9d48991

Please sign in to comment.