Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copy this file to .env and update values for local development
# cp .env.example .env

# Backend
DATABASE_URL=postgresql+psycopg://postgres:postgres@postgres:5432/zaban_backend_development
SECRET_KEY=your-local-secret-key
ALLOWED_HOSTS=localhost,127.0.0.1

# Frontend
NEXT_PUBLIC_EXTERNAL_API_URL=http://localhost:8000
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Environment variables
.env
.env.local
.env.*.local

# Docker
docker-compose.override.yml
Expand Down
48 changes: 0 additions & 48 deletions docker-compose.prod.yml

This file was deleted.

12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ services:
context: ./zaban_backend
dockerfile: Dockerfile
container_name: zaban-backend
env_file:
- ./zaban_backend/.env
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql+psycopg://postgres:postgres@postgres:5432/zaban_backend_development}
- DATABASE_URL=${DATABASE_URL}
- SECRET_KEY=${SECRET_KEY:-}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-}
ports:
- "8000:8000"
depends_on:
Expand All @@ -45,11 +45,11 @@ services:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- NEXT_PUBLIC_EXTERNAL_API_URL=${NEXT_PUBLIC_EXTERNAL_API_URL:-http://localhost:8000}
container_name: zaban-frontend
env_file:
- ./frontend/.env
environment:
NEXT_PUBLIC_EXTERNAL_API_URL: ${NEXT_PUBLIC_EXTERNAL_API_URL:-http://localhost:8000}
- NEXT_PUBLIC_EXTERNAL_API_URL=${NEXT_PUBLIC_EXTERNAL_API_URL:-http://localhost:8000}
ports:
- "3000:3000"
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules
.gitignore
README.md
*.md
.env
.env*
.env*.local
.vscode
.idea
Expand Down
4 changes: 4 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ COPY --from=deps /app/node_modules ./node_modules
# Copy application code
COPY . .

# Build arguments for NEXT_PUBLIC_* variables (must be available at build time)
ARG NEXT_PUBLIC_EXTERNAL_API_URL
ENV NEXT_PUBLIC_EXTERNAL_API_URL=${NEXT_PUBLIC_EXTERNAL_API_URL}

# Set build-time environment variables
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_ENV=production
Expand Down