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:
web:
extends:
file: compose.yaml
file: compose-parent.yaml
service: web
depends_on:
db:
@ -21,14 +21,14 @@ services:
db:
extends:
file: compose.yaml
file: compose-parent.yaml
service: db
networks:
- blog-network
oauth2:
extends:
file: compose.yaml
file: compose-parent.yaml
service: oauth2
networks:
- 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:
web:
build:
context: .
depends_on:
db:
condition: service_healthy
restart: always
ports:
- "8080:8080"
extends:
file: compose-parent.yaml
service: web
environment:
- 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_USER_INFO_URI=http://oauth2:8080/verify
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
extends:
file: compose-parent.yaml
service: db
oauth2:
build:
context: https://github.com/dsv-su/toker.git
dockerfile: embedded.Dockerfile
restart: always
ports:
- '59999:8080'
extends:
file: compose-parent.yaml
service: oauth2
environment:
- CLIENT_ID=blog
- CLIENT_SECRET=s3cr3t
- CLIENT_REDIRECT_URI=http://localhost:8080/login/oauth2/code/local