Skip to content
This repository has been archived by the owner on Feb 19, 2025. It is now read-only.

Commit

Permalink
deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Niklas Kerkhoff committed Nov 17, 2024
1 parent ecea528 commit 2c3440a
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'deployment'
pull_request:
branches: [ "main" ]
paths-ignore:
- '**.md'
- 'deployment'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.DS_STORE
deployment/env
82 changes: 82 additions & 0 deletions deployment/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
services:
tutor-assistant-nginx-proxy:
image: nginx:1.27
container_name: tutor-assistant-nginx-proxy
restart: always
ports:
- "80:80"
volumes:
- ./tutor-assistant-nginx-proxy.conf:/etc/nginx/nginx.conf:ro
depends_on:
- tutor-assistant-web
- tutor-assistant-app-service
- tutor-assistant-keycloak

tutor-assistant:
image: zaeunepyrite01/tutor-assistant:latest
container_name: tutor-assistant
restart: always
env_file:
- env/.tutor-assistant.env
volumes:
- ./data/tutor-assistant-data:/var/lib/tutor-assistant/data

tutor-assistant-web:
image: zaeunepyrite01/tutor-assistant-web:latest
container_name: tutor-assistant-web
restart: always

tutor-assistant-app-service:
image: zaeunepyrite01/tutor-assistant-app-service:latest
container_name: tutor-assistant-app-service
restart: always
depends_on:
- tutor-assistant-app-service-postgres
env_file:
- env/.tutor-assistant-app-service.env
volumes:
- ./data/tutor-assistant-app-service-logs:/var/log/tutor-assistant-app-service-logs
extra_hosts:
- myhost:host-gateway

tutor-assistant-app-service-postgres:
image: postgres:16.4-alpine3.20
container_name: tutor-assistant-app-service-postgres
restart: always
env_file:
- env/.tutor-assistant-app-service-postgres.env
volumes:
- ./data/tutor-assistant-app-service-postgres-data:/var/lib/postgresql/data

tutor-assistant-keycloak:
image: quay.io/keycloak/keycloak:25.0.4
container_name: tutor-assistant-keycloak
restart: always
command: start --proxy-headers forwarded
depends_on:
- tutor-assistant-keycloak-postgres
env_file:
- env/.tutor-assistant-keycloak.env

tutor-assistant-keycloak-postgres:
image: postgres:16.4-alpine3.20
container_name: tutor-assistant-keycloak-postgres
restart: always
env_file:
- env/.tutor-assistant-keycloak-postgres.env
volumes:
- ./data/tutor-assistant-keycloak-postgres-data:/var/lib/postgresql/data

tutor-assistant-seaweedfs-master:
image: chrislusf/seaweedfs
container_name: tutor-assistant-seaweedfs-master
restart: always
command: 'master'

tutor-assistant-seaweedfs-volume:
image: chrislusf/seaweedfs
container_name: tutor-assistant-seaweedfs-volume
restart: always
command: 'volume -mserver tutor-assistant-seaweedfs-master:9333 -dir /var/lib/seaweedfs/data'
volumes:
- ./data/tutor-assistant-seaweedfs-volume-data:/var/lib/seaweedfs/data
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_USER=postgres
POSTGRES_PASSWORD=password
POSTGRES_DB=tutor-assistant-app-service
7 changes: 7 additions & 0 deletions deployment/template-env/.tutor-assistant-app-service.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SPRING_DATASOURCE_USERNAME=postgres
SPRING_DATASOURCE_PASSWORD=password
SPRING_DATASOURCE_HOST=tutor-assistant-app-service-postgres:5432
KEYCLOAK_ISSUER_URI=http://myhost/auth/realms/tutor-assistant
TUTOR_ASSISTANT_BASE_URL=http://tutor-assistant:8500
SEAWEEDFS_MASTER_URL=http://tutor-assistant-seaweedfs-master:9333/dir/assign
LOGS_PATH=/var/log/tutor-assistant-app-service-logs/tutor-assistant-app-service.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
POSTGRES_DB=tutor-assistant-keycloak
POSTGRES_USER=user
POSTGRES_PASSWORD=password
14 changes: 14 additions & 0 deletions deployment/template-env/.tutor-assistant-keycloak.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
KC_PROXY_ADDRESS_FORWARDING=true
KC_HOSTNAME_STRICT=false
KC_HOSTNAME_STRICT_HTTPS=false
KC_HTTP_RELATIVE_PATH=/auth
KC_PROXY=edge
KC_HTTP_ENABLED=true
KC_DB=postgres
KC_DB_USERNAME=user
KC_DB_PASSWORD=password
KC_DB_URL_HOST=tutor-assistant-keycloak-postgres
KC_DB_URL_PORT=5432
KC_DB_URL_DATABASE=tutor-assistant-keycloak
KEYCLOAK_ADMIN=admin
KEYCLOAK_ADMIN_PASSWORD=password
3 changes: 3 additions & 0 deletions deployment/template-env/.tutor-assistant.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DATA_DIR=/var/lib/tutor-assistant/data
HOST=tutor-assistant
OPENAI_API_KEY=your-key
24 changes: 24 additions & 0 deletions deployment/tutor-assistant-nginx-proxy.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
events { }

http {
server {
listen 80;

location /api/ {
proxy_pass http://tutor-assistant-app-service:8080/api/;
}

location /auth/ {
proxy_pass http://tutor-assistant-keycloak:8080/auth/;
}

location / {
proxy_pass http://tutor-assistant-web:80;
}

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

0 comments on commit 2c3440a

Please sign in to comment.