Skip to content

Commit

Permalink
fixed a lot of broken stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Lysquid committed Sep 19, 2023
1 parent e52845f commit 7cebd2e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ RUN pip install -r requirements.txt
COPY . /app/
RUN python manage.py collectstatic --no-input

CMD ["gunicorn", "clubBDM.wsgi", "--bind", "0.0.0.0:8000"]
CMD ["gunicorn", "clubBDM.wsgi", "--bind", "0.0.0.0:8001"]
1 change: 1 addition & 0 deletions clubBDM/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
ALLOWED_HOSTS = [
'localhost',
'127.0.0.1',
'0.0.0.0',
]
if 'SITE_URL' in os.environ:
ALLOWED_HOSTS.append(os.getenv('SITE_URL'))
Expand Down
24 changes: 17 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
image: mariadb:11
volumes:
- database:/var/lib/mysql:rw
networks:
- database
environment:
- MARIADB_DATABASE=${DB_NAME}
- MARIADB_USER=${DB_USER}
Expand All @@ -12,32 +14,40 @@ services:
app:
build: .
volumes:
- nginx:/app/nginx:ro
- static:/app/static:rw
- media:/app/media:rw
networks:
- database
- nginx
environment:
- DB_NAME
- DB_USER
- DB_PASSWORD
- SECRET_KEY
- SITE_URL
- DEBUG=0
- DEBUG=${DEBUG:-0}
depends_on:
- db

nginx:
image: nginx:1
build: ./nginx
ports:
- 8001:8000
- 8001:8001
volumes:
- nginx:/etc/nginx/conf.d:ro
- static:/app/static:ro
- media:/app/media:ro
networks:
- nginx
depends_on:
- app

networks:
database:
driver: bridge
nginx:
driver: bridge

volumes:
database:
static:
media:
nginx:
media:
3 changes: 3 additions & 0 deletions nginx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# syntax=docker/dockerfile:1
FROM nginx:1
COPY default.conf /etc/nginx/conf.d
4 changes: 2 additions & 2 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 8000;
listen 8001;
server_name bdm.insalgo.fr;

location /static/ {
Expand All @@ -11,7 +11,7 @@ server {
}

location / {
proxy_pass http://app:8000;
proxy_pass http://app:8001;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect off;
Expand Down

0 comments on commit 7cebd2e

Please sign in to comment.