Deploy PRs to branch.dsv.su.se #1

Open
ansv7779 wants to merge 14 commits from deploy into main
3 changed files with 52 additions and 38 deletions
Showing only changes of commit 06d493e720 - Show all commits

View File

@ -1,7 +1,7 @@
services: services:
web: web:
extends: extends:
file: compose.yaml file: compose-parent.yaml
service: web service: web
depends_on: depends_on:
db: db:
@ -21,14 +21,14 @@ services:
db: db:
extends: extends:
file: compose.yaml file: compose-parent.yaml
service: db service: db
networks: networks:
- blog-network - blog-network
oauth2: oauth2:
extends: extends:
file: compose.yaml file: compose-parent.yaml
service: oauth2 service: oauth2
networks: networks:
- traefik - traefik

40
compose-parent.yaml Normal file
View File

@ -0,0 +1,40 @@
services:
web:
build:
context: .
restart: always
ports:
- "8080:8080"
db:
image: mariadb:latest
restart: always
environment:
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
MARIADB_ROOT_HOST: "localhost"
MARIADB_DATABASE: "branch"
MARIADB_USER: "branch"
MARIADB_PASSWORD: "branch"
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect"]
start_period: 5s
interval: 3s
timeout: 1s
retries: 5
# volumes:
# - type: bind
# source: ./db/
# target: /docker-entrypoint-initdb.d/
# read_only: true
oauth2:
build:
context: https://github.com/dsv-su/toker.git
dockerfile: embedded.Dockerfile
restart: always
ports:
- '59999:8080'
environment:
- CLIENT_ID=blog
- CLIENT_SECRET=s3cr3t

View File

@ -1,47 +1,21 @@
services: services:
web: web:
build: extends:
context: . file: compose-parent.yaml
depends_on: service: web
db:
condition: service_healthy
restart: always
ports:
- "8080:8080"
environment: environment:
- OAUTH2_AUTHORIZATION_URI=http://localhost:59999/authorize # exposed port since browser has to access - OAUTH2_AUTHORIZATION_URI=http://localhost:59999/authorize # exposed port since browser has to access
- OAUTH2_TOKEN_URI=http://oauth2:8080/exchange # inside the docker network - OAUTH2_TOKEN_URI=http://oauth2:8080/exchange # inside the docker network
- OAUTH2_USER_INFO_URI=http://oauth2:8080/verify - OAUTH2_USER_INFO_URI=http://oauth2:8080/verify
db: db:
image: mariadb:latest extends:
restart: always file: compose-parent.yaml
environment: service: db
MARIADB_RANDOM_ROOT_PASSWORD: "yes"
MARIADB_ROOT_HOST: "localhost"
MARIADB_DATABASE: "branch"
MARIADB_USER: "branch"
MARIADB_PASSWORD: "branch"
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect"]
start_period: 5s
interval: 3s
timeout: 1s
retries: 5
# volumes:
# - type: bind
# source: ./db/
# target: /docker-entrypoint-initdb.d/
# read_only: true
oauth2: oauth2:
build: extends:
context: https://github.com/dsv-su/toker.git file: compose-parent.yaml
dockerfile: embedded.Dockerfile service: oauth2
restart: always
ports:
- '59999:8080'
environment: environment:
- CLIENT_ID=blog
- CLIENT_SECRET=s3cr3t
- CLIENT_REDIRECT_URI=http://localhost:8080/login/oauth2/code/local - CLIENT_REDIRECT_URI=http://localhost:8080/login/oauth2/code/local