Skip to content

Commit

Permalink
add docker-compose
Browse files Browse the repository at this point in the history
  • Loading branch information
chenyuan99 committed Jan 28, 2025
1 parent 71acb0b commit 9434628
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
56 changes: 56 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: '3.8'

services:
db:
image: postgres:16-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${POSTGRES_DB:-offersplus}
- POSTGRES_USER=${POSTGRES_USER:-offersplus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-offersplus}
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-offersplus}"]
interval: 5s
timeout: 5s
retries: 5

web:
build: .
volumes:
- .:/app
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
ports:
- "8000:8000"
environment:
- POSTGRES_DB=${POSTGRES_DB:-offersplus}
- POSTGRES_USER=${POSTGRES_USER:-offersplus}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-offersplus}
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- DJANGO_SETTINGS_MODULE=offer_plus.settings
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY:-your-secret-key}
- DJANGO_DEBUG=${DJANGO_DEBUG:-False}
- DJANGO_ALLOWED_HOSTS=${DJANGO_ALLOWED_HOSTS:-localhost,127.0.0.1}
depends_on:
db:
condition: service_healthy

nginx:
image: nginx:alpine
volumes:
- static_volume:/app/staticfiles
- media_volume:/app/mediafiles
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
ports:
- "80:80"
depends_on:
- web

volumes:
postgres_data:
static_volume:
media_volume:
11 changes: 11 additions & 0 deletions frontend/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Supabase Configuration
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key

# API Configuration
VITE_API_URL=https://api.offerplus.io

# Site Configuration
VITE_SITE_URL=https://www.offerplus.io

# Note: Make sure to restart the dev server after updating these variables

0 comments on commit 9434628

Please sign in to comment.