-
Notifications
You must be signed in to change notification settings - Fork 1
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
Showing
2 changed files
with
74 additions
and
0 deletions.
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,23 @@ | ||
server { | ||
listen 80; | ||
server_name api.phrinifluent.com; | ||
|
||
location /static/ { | ||
alias /code/staticfiles/; | ||
} | ||
|
||
location / { | ||
proxy_pass http://web:8000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
|
||
# SSL configuration | ||
listen 443 ssl; | ||
ssl_certificate /etc/ssl/certs/phrinifluent.crt; | ||
ssl_certificate_key /etc/ssl/certs/phrinifluent.key; | ||
|
||
# Further SSL options and optimizations can be added here | ||
} |
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,51 @@ | ||
version: '3.8' | ||
|
||
services: | ||
web: | ||
build: . | ||
command: gunicorn core.wsgi:application --bind 0.0.0.0:8000 | ||
volumes: | ||
- .:/code | ||
- static_volume:/code/staticfiles | ||
env_file: | ||
- .env.prod | ||
depends_on: | ||
- db | ||
networks: | ||
- internal | ||
|
||
nginx: | ||
image: nginx:1.21 | ||
ports: | ||
- "80:80" | ||
- "443:443" | ||
volumes: | ||
- static_volume:/code/staticfiles | ||
- ./conf/nginx.conf:/etc/nginx/conf.d/default.conf | ||
- /etc/ssl/certs/phrinifluent.crt:/etc/ssl/certs/phrinifluent.crt:ro | ||
- /etc/ssl/certs/phrinifluent.key:/etc/ssl/certs/phrinifluent.key:ro | ||
depends_on: | ||
- web | ||
networks: | ||
- internal | ||
|
||
db: | ||
image: postgres | ||
volumes: | ||
- postgres_data:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: ${DB_USER} | ||
POSTGRES_PASSWORD: ${DB_PASSWORD} | ||
POSTGRES_DB: ${DB_NAME} | ||
networks: | ||
- internal | ||
|
||
# Volumes | ||
volumes: | ||
postgres_data: | ||
static_volume: | ||
|
||
# Networks | ||
networks: | ||
internal: | ||
driver: bridge |