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
1 change: 0 additions & 1 deletion Dockerfile

This file was deleted.

13 changes: 13 additions & 0 deletions app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM python:3.10-slim-buster

WORKDIR /app

COPY requirements.txt .

RUN pip install --no-cache-dir -r requirements.txt

COPY . .

RUN python manage.py collectstatic --noinput

EXPOSE 8000
38 changes: 37 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1 +1,37 @@
# ADD Docker Compose CONTENT HERE
version: '3.8'

services:
postgres:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env

redis:
image: redis:6-alpine

backend:
build: ./app
command: gunicorn config.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/app/staticfiles
env_file:
- ./.env
depends_on:
- postgres
- redis

nginx:
image: nginx:alpine
ports:
- "8080:80"
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- static_volume:/app/staticfiles
depends_on:
- backend

volumes:
postgres_data:
static_volume:
15 changes: 14 additions & 1 deletion nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
# ADD NGINX CONTENT HERE
# ADD NGINX CONTENT HERE
upstream backend {
server backend:8000;
}
server {
listen 80;
location / {
proxy_pass http://backend;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}