-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deploy): get Docker container working
Initial Docker setup, with only API + Postgres + Caddy reverse proxy
- Loading branch information
Showing
16 changed files
with
118 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Ignore everything, except... | ||
* | ||
|
||
# Pakcages | ||
!deno.json | ||
!deno.lock | ||
|
||
# Source | ||
!apps/ | ||
!packages/ |
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 @@ | ||
# Ignore everything, except... | ||
* | ||
|
||
# Pakcages | ||
!deno.json | ||
!deno.lock | ||
|
||
# Source | ||
!src/ | ||
!drizzle.config.ts | ||
!init.sh | ||
|
||
# ...but always include these files... | ||
README.md | ||
routes.md | ||
.zed | ||
.*ignore |
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,28 @@ | ||
FROM denoland/deno:alpine-2.1.4 | ||
|
||
WORKDIR /app | ||
# make /app belong to deno user | ||
RUN chown -R deno:deno /app | ||
|
||
# Prefer not to run as root. | ||
USER deno | ||
|
||
# Cache the dependencies as a layer (the following two steps are re-run only when deps.ts is modified). | ||
# Ideally cache deps.ts will download and compile _all_ external files used in main.ts. | ||
COPY --chown=deno:deno deno.json deno.lock ./ | ||
|
||
# These steps will be re-run upon each file change in your working directory: | ||
COPY --chown=deno:deno packages packages | ||
COPY --chown=deno:deno apps/api apps/api | ||
COPY --chown=deno:deno apps/auth/deno.json ./apps/auth/deno.json | ||
|
||
WORKDIR /app/apps/api | ||
|
||
# The port that your application listens to. | ||
EXPOSE 1993 | ||
ENV PORT=1993 | ||
|
||
# Compile the main app so that it doesn't need to be compiled each startup/entry. | ||
RUN deno cache ./src/main.ts | ||
|
||
CMD ["task", "start"] |
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
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
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
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
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
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,47 @@ | ||
services: | ||
api: | ||
build: | ||
context: . | ||
dockerfile: ./apps/api/Dockerfile | ||
environment: | ||
- LOG_LEVEL=debug | ||
- DB_HOST=db | ||
ports: | ||
- 1993:1993 | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
|
||
db: | ||
image: postgres:17-alpine | ||
ports: | ||
- 5432:5432 | ||
environment: | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_USER=postgres | ||
- POSTGRES_DB=karr | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
|
||
caddy: | ||
image: caddy:2-alpine | ||
restart: unless-stopped | ||
ports: | ||
- "8080:8080" | ||
#- "443:443" | ||
#- "443:443/udp" | ||
environment: | ||
- TZ=Europe/Paris | ||
- HOST=localhost:8080 | ||
- API_PORT=1993 | ||
volumes: | ||
- ./Caddyfile:/etc/caddy/Caddyfile | ||
- caddy_data:/data | ||
- caddy_config:/config | ||
|
||
volumes: | ||
caddy_data: | ||
caddy_config: |
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