-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
167 additions
and
52 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
.env.local | ||
node_modules | ||
|
||
gen-api | ||
gen-api | ||
caddy/data |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
:80 { | ||
handle_path /api/* { | ||
reverse_proxy server:3000 | ||
} | ||
|
||
handle /socket.io/* { | ||
reverse_proxy server:3000 | ||
} | ||
|
||
handle /console/* { | ||
reverse_proxy console:3000 | ||
} | ||
|
||
handle { | ||
reverse_proxy frontend:3000 | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{$CLOUD_APP_WILDCARD_DOMAIN}:443 { | ||
tls { | ||
dns godaddy {$CLOUD_APP_WILDCARD_DOMAIN_DNS_API_KEY} | ||
} | ||
|
||
reverse_proxy gateway | ||
} | ||
|
||
{$CLOUD_CONSOLE_URL}:443 { | ||
@console { | ||
path /console/* | ||
} | ||
|
||
@api { | ||
path /api/* | ||
} | ||
|
||
handle @console { | ||
reverse_proxy gateway | ||
} | ||
|
||
handle @api { | ||
reverse_proxy gateway | ||
} | ||
|
||
handle { | ||
rewrite * /console{path} | ||
reverse_proxy gateway | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
FROM caddy:2.7.4-builder-alpine as builder | ||
|
||
RUN xcaddy build \ | ||
--with github.com/caddy-dns/godaddy | ||
|
||
FROM caddy:2.7.4-alpine | ||
|
||
COPY --from=builder /usr/bin/caddy /usr/bin/caddy |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
version: '3.8' | ||
|
||
volumes: | ||
postgres-data: | ||
|
||
services: | ||
|
||
cloud-proxy: | ||
# TODO: build cloud proxy image in a pipeline and turn it into a proper package | ||
# Not urgent as this is used only to host the cloud version. | ||
build: | ||
context: cloud-proxy | ||
volumes: | ||
- ./cloud-proxy/Caddyfile:/etc/caddy/Caddyfile | ||
ports: | ||
- 80:80 | ||
- 443:443 | ||
depends_on: | ||
- gateway | ||
environment: | ||
- CLOUD_CONSOLE_URL=${CLOUD_CONSOLE_URL} | ||
- CLOUD_APP_WILDCARD_DOMAIN=${CLOUD_APP_WILDCARD_DOMAIN} | ||
- CLOUD_APP_WILDCARD_DOMAIN_DNS_API_KEY=${CLOUD_APP_WILDCARD_DOMAIN_DNS_API_KEY} | ||
restart: unless-stopped | ||
|
||
gateway: | ||
image: ${CADDY_IMAGE} | ||
volumes: | ||
- ./caddy/config/Caddyfile:/etc/caddy/Caddyfile | ||
depends_on: | ||
- frontend | ||
- server | ||
restart: unless-stopped | ||
|
||
postgres: | ||
image: ${POSTGRES_IMAGE} | ||
environment: | ||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD} | ||
- POSTGRES_USER=${POSTGRES_USER} | ||
- POSTGRES_DB=${POSTGRES_DB} | ||
volumes: | ||
- postgres-data:/var/lib/postgresql/data | ||
restart: unless-stopped | ||
|
||
server: | ||
image: ${SERVER_IMAGE} | ||
environment: | ||
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT} | ||
- USERS_ACCESS_TOKEN_SECRET=${USERS_ACCESS_TOKEN_SECRET} | ||
depends_on: | ||
- postgres | ||
restart: unless-stopped | ||
|
||
frontend: | ||
image: ${FRONTEND_IMAGE} | ||
depends_on: | ||
- server | ||
restart: unless-stopped | ||
|
||
console: | ||
image: ${CONSOLE_IMAGE} | ||
depends_on: | ||
- server | ||
restart: unless-stopped |
This file contains 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
This file contains 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