Last active
July 11, 2019 11:25
-
-
Save hosszukalman/e78572d9db857634d412758a713c2ad7 to your computer and use it in GitHub Desktop.
Monorepo with golang back-end, front-end and Caddy server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yourhost.dev:80 yourhost.dev:443 { | |
tls self_signed | |
proxy /api backend:8080 { | |
without /api | |
websocket | |
} | |
log stdout | |
errors stderr | |
gzip { | |
level 9 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
backend: | |
build: ./src/backend | |
volumes: | |
- ./src/backend:/go/src/github.com/some/path | |
command: sh -c "go build -mod vendor && ./backend" | |
ports: | |
- "8080:8080" | |
restart: always | |
depends_on: | |
- "backend" | |
backenddb: | |
image: postgres:11.3 | |
ports: | |
- "5432:5432" | |
volumes: | |
- ./src/backend/db:/var/lib/postgresql/data | |
- ./src/backend/sql:/docker-entrypoint-initdb.d/ | |
restart: always | |
frontend: | |
build: ./src/frontend | |
volumes: | |
- ./src/frontend/public:/srv | |
- ./src/frontend/Caddyfile:/etc/Caddyfile | |
ports: | |
- "80:80" | |
- "443:443" | |
restart: always | |
depends_on: | |
- "backend" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM abiosoft/caddy | |
COPY public /srv | |
COPY Caddyfile /etc/ | |
# Expose http and https ports. | |
EXPOSE 80 | |
EXPOSE 443 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment