Skip to content

Commit dda2e8d

Browse files
committed
Add frontend to docker compose and add 3rd party api key variables to example env
1 parent f624a41 commit dda2e8d

3 files changed

Lines changed: 56 additions & 17 deletions

File tree

.env.docker.example

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ LITESTAR_DEBUG=true
44
LITESTAR_HOST=0.0.0.0
55
LITESTAR_PORT=8000
66
APP_URL=http://localhost:${LITESTAR_PORT}
7-
87
LOG_LEVEL=10
8+
99
# Database
1010
DATABASE_ECHO=true
1111
DATABASE_ECHO_POOL=true
1212
DATABASE_POOL_DISABLE=false
1313
DATABASE_POOL_MAX_OVERFLOW=5
1414
DATABASE_POOL_SIZE=5
1515
DATABASE_POOL_TIMEOUT=30
16-
DATABASE_URL=postgresql+asyncpg://app:app@db:5432/app
16+
DATABASE_URL=postgresql+asyncpg://app_user:app_password@db:5432/chapter-app-db
1717

1818
# Cache
1919
REDIS_URL=redis://cache:6379/0
@@ -23,8 +23,25 @@ SAQ_WEB_ENABLED=True
2323
SAQ_BACKGROUND_WORKERS=1
2424
SAQ_CONCURRENCY=1
2525

26-
VITE_HOST=localhost
27-
VITE_PORT=3006
28-
VITE_HOT_RELOAD=True
29-
VITE_DEV_MODE=True
30-
ALLOWED_CORS_ORIGINS=["localhost:3006","localhost:8000"]
26+
# 3rd party tokens
27+
28+
# logo.dev
29+
LOGO_DEV_TOKEN=
30+
31+
# scraperapi.com
32+
SCRAPERAPI_API_KEY=
33+
34+
# openai.com
35+
OPENAI_MODEL_NAME=
36+
OPENAI_API_KEY=
37+
38+
# peopledatalabs.com
39+
PDL_API_KEY=
40+
41+
# pitchbook.com
42+
PB_API_KEY=
43+
44+
# Frontend
45+
NEXT_PUBLIC_POSTHOG_KEY=
46+
NEXT_PUBLIC_POSTHOG_HOST= https://eu.posthog.com
47+
NEXT_PUBLIC_CHAPTER_API_URL=${APP_URL}/api

docker-compose.yml

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ services:
2323
timeout: 3s
2424
retries: 30
2525
db:
26-
image: postgres:latest
26+
image: postgres:16
2727
ports:
2828
- "15432:5432"
2929
hostname: db
3030
environment:
31-
POSTGRES_PASSWORD: "app"
32-
POSTGRES_USER: "app"
33-
POSTGRES_DB: "app"
31+
POSTGRES_PASSWORD: "app_password"
32+
POSTGRES_USER: "app_user"
33+
POSTGRES_DB: "chapter-app-db"
3434
volumes:
3535
- db-data:/var/lib/postgresql/data
3636
restart: unless-stopped
@@ -43,7 +43,9 @@ services:
4343
- CMD
4444
- pg_isready
4545
- -U
46-
- app
46+
- app_user
47+
- -d
48+
- chapter-app-db
4749
interval: 2s
4850
timeout: 3s
4951
retries: 40
@@ -63,7 +65,13 @@ services:
6365
environment:
6466
SAQ_USE_SERVER_LIFESPAN: "false"
6567
env_file:
66-
- .env.docker.example
68+
- .env
69+
healthcheck:
70+
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
71+
interval: 30s
72+
retries: 3
73+
start_period: 10s
74+
timeout: 5s
6775
worker:
6876
image: app:latest
6977
command: litestar workers run
@@ -74,18 +82,31 @@ services:
7482
cache:
7583
condition: service_healthy
7684
env_file:
77-
- .env.docker.example
85+
- .env
7886
migrator:
7987
image: app:latest
8088
restart: "no"
8189
command: litestar database upgrade --no-prompt
8290
env_file:
83-
- .env.docker.example
91+
- .env
8492
depends_on:
8593
db:
8694
condition: service_healthy
8795
cache:
8896
condition: service_healthy
97+
frontend:
98+
build:
99+
context: .
100+
dockerfile: deploy/docker/run/Dockerfile.frontend
101+
image: frontend:latest
102+
restart: always
103+
depends_on:
104+
app:
105+
condition: service_healthy
106+
ports:
107+
- "3000:3000"
108+
env_file:
109+
- .env
89110
volumes:
90111
db-data: {}
91112
cache-data: {}

frontend/next.config.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const nextConfig = {
33
images: {
44
domains: ["img.logo.dev"], // Add the domain you want to allow
55
},
6-
};
6+
output: "standalone",
7+
}
78

8-
export default nextConfig;
9+
export default nextConfig

0 commit comments

Comments
 (0)