-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c63c985
commit 959f8ef
Showing
4 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.9 | ||
|
||
ENV PYTHONUNBUFFERED=1 | ||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install -r requirements.txt | ||
|
||
COPY . /usr/src/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
upstream django-backend { | ||
ip_hash; | ||
server django-backend:8000; | ||
} | ||
|
||
server { | ||
location / { | ||
proxy_set_header X-Forwarded-Host localhost; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
proxy_set_header X-Forwarded-Proto http; | ||
proxy_set_header Host $http_host; | ||
proxy_pass http://django-backend/; | ||
} | ||
|
||
location /static { | ||
alias /static; | ||
} | ||
listen 80; | ||
server_name localhost; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: "3" | ||
services: | ||
django-backend: | ||
container_name: django-backend | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
restart: always | ||
ports: | ||
- "8000:8000" | ||
env_file: | ||
- .env | ||
command: | ||
- bash | ||
- -c | ||
- | | ||
echo yes | python manage.py collectstatic | ||
gunicorn ideaconcert.wsgi:application --bind 0.0.0.0:8000 | ||
volumes: | ||
- .:/usr/src/app | ||
|
||
nginx: | ||
image: nginx:1.21 | ||
container_name: nginx | ||
restart: always | ||
volumes: | ||
- ./config/nginx:/etc/nginx/conf.d | ||
- ./static:/static | ||
ports: | ||
- "80:80" | ||
depends_on: | ||
- django-backend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters