Skip to content

Commit

Permalink
docker: add caddyserver and dual worker
Browse files Browse the repository at this point in the history
Run behind a Caddy server to show a more realistic setup and run two
workers in parrallel using different cache folders.

Signed-off-by: Paul Spooren <mail@aparcar.org>
  • Loading branch information
aparcar committed Aug 11, 2021
1 parent 7f26167 commit 1d095f0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 5 deletions.
23 changes: 21 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
volumes:
- "./asu-service:/home/build/asu/"
ports:
- 8000:8000
- 8000
depends_on:
- redis

Expand All @@ -27,9 +27,28 @@ services:
build:
dockerfile: Dockerfile.worker
volumes:
- "./asu-service:/home/build/asu/"
- "./asu-service/public:/home/build/asu/public"
- "./asu-service/cache:/home/build/asu/cache"
depends_on:
- redis

worker2:
image: aparcar/asu-worker
build:
dockerfile: Dockerfile.worker
volumes:
- "./asu-service/public:/home/build/asu/public"
- "./asu-service/cache2:/home/build/asu/cache"
depends_on:
- redis

redis:
image: "redis:alpine"

webserver:
image: caddy
volumes:
- "./misc/Caddyfile:/etc/caddy/Caddyfile"
- "./asu-service:/site/"
ports:
- 80:80
6 changes: 3 additions & 3 deletions misc/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
asu.aparcar.org {
root * /home/debian/asu/public/
:80 {
root * /site/
file_server browse
header Access-Control-Allow-Methods "POST, GET, OPTIONS"
header Access-Control-Allow-Headers "*"
header Access-Control-Allow-Origin "*"
reverse_proxy /api/* localhost:8000
reverse_proxy /api/* server:8000
}

0 comments on commit 1d095f0

Please sign in to comment.