Initial commit

This commit is contained in:
Markus Thielker 2024-03-08 20:24:40 +01:00 committed by GitHub
commit 52aed24a96
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
48 changed files with 6980 additions and 0 deletions

1
docker/base-dev/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
postgres-data/

View file

@ -0,0 +1,19 @@
services:
postgres:
container_name: base_postgres
image: postgres:15.2
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- 127.0.0.1:5432:5432
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: base
volumes:
- ./postgres-data:/var/lib/postgresql/data

1
docker/base-prod/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
postgres-data/

View file

@ -0,0 +1,76 @@
services:
app-migrations:
container_name: base_migrations
image: markusthielker/next-base:1.0.0
env_file:
- .env
depends_on:
postgres:
condition: service_healthy
command: [ "npx", "prisma", "migrate", "deploy" ]
networks:
- internal
app:
container_name: base_app
image: markusthielker/next-base:1.0.0
env_file:
- .env
depends_on:
app-migrations:
condition: service_completed_successfully
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.xyz-base.rule=Host(`base.thielker.xyz`)"
- "traefik.http.routers.xyz-base.entrypoints=web, websecure"
- "traefik.http.routers.xyz-base.tls=true"
- "traefik.http.routers.xyz-base.tls.certresolver=lets-encrypt"
networks:
- web
- internal
app-studio:
container_name: base_studio
image: markusthielker/next-base:1.0.0
env_file:
- .env
depends_on:
app-migrations:
condition: service_completed_successfully
command: "npx prisma studio"
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.xyz-base-studio.rule=Host(`db.base.thielker.xyz`)"
- "traefik.http.routers.xyz-base-studio.entrypoints=web, websecure"
- "traefik.http.services.xyz-finances-db.loadbalancer.server.port=5555"
- "traefik.http.routers.xyz-base-studio.tls=true"
- "traefik.http.routers.xyz-base-studio.tls.certresolver=lets-encrypt"
networks:
- web
- internal
postgres:
container_name: base_postgres
image: postgres:15.2
restart: unless-stopped
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
POSTGRES_DB: base
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
- internal
networks:
web:
external: true
internal: