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 Sep 3, 2024
1 parent aca8aee commit b6d485c
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 13 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
33 changes: 33 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# To use this file, run `docker-compose up`.
version: '3.4'

x-backend-config: &backend
build:
context: "."
dockerfile: "./scripts/docker/Dockerfile.backend"

services:
# Main application
backend:
<<: *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:
<<: *backend
volumes:
- .:/usr/src/app

frontend:
build:
context: "."
dockerfile: "./scripts/docker/Dockerfile.frontend"
volumes:
- ".:/usr/src/app"
labels:
- traefik.http.routers.frontend.rule=Host(`localhost`) || Host(`127.0.0.1`)
- traefik.http.services.frontend.loadbalancer.server.port=80
28 changes: 15 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
version: "3"

name: tasking-manager-main

volumes:
tm_db_data:
name: tm-db-data-main

networks:
tm-net:
name: tm-net

x-backend-config: &backend
image: ghcr.io/osmitalia/osmit-tm-backend:v4.8
env_file: ${ENV_FILE:-tasking-manager.env}
depends_on:
- postgresql
networks:
- tm-net

services:
tm-db:
image: "postgis/postgis:${POSTGIS_TAG:-14-3.3}"
postgresql:
image: "mdillon/postgis:11"
volumes:
- tm_db_data:/var/lib/postgresql/data/
- /srv/postgresql:/var/lib/postgresql/data
env_file:
- tasking-manager.env
- ${ENV_FILE:-tasking-manager.env}
restart: unless-stopped
healthcheck:
test: pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}
Expand Down Expand Up @@ -55,7 +57,7 @@ services:
cpus: "1"
memory: 100M
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
networks:
- tm-net
Expand Down Expand Up @@ -108,14 +110,14 @@ services:
- tm-net

tm-frontend:
image: ghcr.io/hotosm/tasking-manager/frontend:main
image: ghcr.io/osmitalia/osmit-tm-frontend:v4.8
build:
context: .
dockerfile: "./scripts/docker/Dockerfile.frontend_development"
env_file:
- tasking-manager.env
labels:
- traefik.http.routers.frontend.rule=Host(`127.0.0.1`) || Host(`localhost`)
- traefik.http.routers.frontend.rule=Host(`osmit-tm4.wmcloud.org`)
- traefik.http.services.frontend.loadbalancer.server.port=3000
networks:
- tm-net

0 comments on commit b6d485c

Please sign in to comment.