Skip to content

Commit

Permalink
feat: enable local frontend development with a Caddy proxy in Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresalice committed May 18, 2021
1 parent 761cb17 commit 9fa2e2b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Caddyfile
@@ -0,0 +1,25 @@
:8800

@room {
path_regexp room ^/[0-9]+$
}

@root {
path root /
}

route @room {
rewrite * /room.html
file_server {
root /srv
}
}

route @root {
rewrite * /index.html
file_server {
root /srv
}
}

reverse_proxy meetingmood:8844
6 changes: 6 additions & 0 deletions README.md
Expand Up @@ -33,6 +33,12 @@ You can optionally:
4. Press buttons to make hand signals
5. Press `x` to stop making a hand signal

## Development

For purely-frontend development we provide a handy docker-compose environment which will let you make changes to the html without needing Go.

Running `docker-compose up` will launch a Caddy proxy listening on http://localhost:8800/ as well as building and launching the checked-out Go code. You can then make changes to the html pages and refresh the browser without needing to rebuild any of the backend components.

## Donations

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/wheresalice)
Expand Down
15 changes: 15 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,15 @@
version: "3.7"

services:
meetingmood:
build: .
caddy:
image: caddy:latest
restart: unless-stopped
ports:
- "8800:8800"
volumes:
- $PWD/Caddyfile:/etc/caddy/Caddyfile
- $PWD:/srv
depends_on:
- meetingmood

0 comments on commit 9fa2e2b

Please sign in to comment.