Skip to content

Commit

Permalink
Merge pull request #4 from sotoncyber/update-docker-stuff
Browse files Browse the repository at this point in the history
Update Docker Stuff
  • Loading branch information
Jacrac04 authored Feb 1, 2025
2 parents d62553c + ad35f7c commit 8ebb3bf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ python -m poetry run gunicorn 'challenge:app'
```

## Running with docker

Run on local machine:
```
docker-compose -p "<project name>" -f "docker/dev-compose.yaml" up --build
```
docker-compose -p "<project name>" -f "docker/compose.yaml" up --build
```

So it can be run on sucss server:
- Edit `docker/prod-compose.yaml` and change all occurrences of `<challenge_name>` to the subdomain of the challenge.
For example if you want the challenge to be hosted on `challenge.sucss.org` then replace `<challenge_name>` with `challenge`.
1 change: 0 additions & 1 deletion docker/compose.yaml → docker/dev-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3'
services:
app:
build:
Expand Down
18 changes: 18 additions & 0 deletions docker/prod-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
services:
app:
build:
context: ../
dockerfile: docker/Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.<challenge-name>.rule=Host(`<challenge-name>.sucss.org`)"
- "traefik.http.routers.<challenge-name>.tls=true"
- "traefik.http.routers.<challenge-name>.middlewares=authentik@file"
- "traefik.http.services.<challenge-name>.loadbalancer.server.port=8000"

networks:
- traefik

networks:
traefik:
external: true
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[tool.poetry]
name = "challenge-template"
version = "0.1.0"
version = "0.1.1"
description = "SUCSS Challenge template"
authors = ["Skyler Mansfield <[email protected]>"]
readme = "README.md"
package-mode = false

[tool.poetry.scripts]
dev = "challenge:main"
Expand Down

0 comments on commit 8ebb3bf

Please sign in to comment.