Skip to content

Commit

Permalink
Merge branch 'develop' into api_routes-implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
PJDeSmijter committed Mar 11, 2024
2 parents 17ecff7 + 1663245 commit 1f3ca8a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile.prod
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ RUN chmod +x $APP_HOME/entrypoint.prod.sh


# chown all the files to the app user
RUN chown -R app:app $APP_HOME/
#RUN chown -R app:app $APP_HOME/

# change to the app user
USER app
#USER app

# run entrypoint.prod.sh
ENTRYPOINT ["/home/app/web/entrypoint.prod.sh"]
2 changes: 2 additions & 0 deletions backend/entrypoint.prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,6 @@ then
echo "PostgreSQL started"
fi

python manage.py collectstatic --noinput

exec "$@"
2 changes: 2 additions & 0 deletions backend/pigeonhole/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"django.middleware.common.CommonMiddleware",
]

CSRF_TRUSTED_ORIGINS = ['http://localhost:8000', 'http://localhost:3000', 'https://sel2-1.ugent.be']

CORS_ALLOW_METHODS = [
"DELETE",
"GET",
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ services:
context: .
command: python manage.py runserver 0.0.0.0:8000
volumes:
#- static_volume:/home/app/web/static
- static_volume:/home/app/web/backend/static
- media_volume:/home/app/web/uploads
expose:
- 8000
Expand All @@ -39,18 +39,19 @@ services:

static:
container_name: statics
image: nginx:alpine
image: httpd:latest
restart: always
volumes:
#- static_volume:/srv
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- static_volume:/usr/local/apache2/htdocs/
depends_on:
- backend
ports:
- 5000:80
labels:
- "traefik.enable=true"
- "traefik.http.routers.static.rule=Host(`sel2-1.ugent.be`) && PathPrefix(`/static`)"
- "traefik.http.routers.static.middlewares=static-stripprefix"
- "traefik.http.middlewares.static-stripprefix.stripprefix.prefixes=/static"
- "traefik.http.routers.static.entrypoints=websecure"
- "traefik.http.routers.static.tls.certresolver=myresolver"

Expand Down

0 comments on commit 1f3ca8a

Please sign in to comment.