Skip to content

Commit

Permalink
fix for beta
Browse files Browse the repository at this point in the history
  • Loading branch information
metantesan committed Oct 31, 2024
1 parent 3a37842 commit 2e5d382
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,3 +133,5 @@ dmypy.json

# database
*.sqlite3
static/
media/
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ COPY src/requirments.txt .
# Install dependencies
RUN pip install -r requirments.txt

RUN pip install gunicorn
# Copy the application code
COPY src/* .

COPY src/ .
# Expose the port for Gunicorn
EXPOSE 8000

# Run migrations and then start Gunicorn
CMD ["sh", "-c", "python manage.py migrate && gunicorn --workers=3 --bind=0.0.0.0:8000 core.wsgi:application"]
# CMD ["sh", "-c", "python manage.py migrate && gunicorn --workers=3 --bind=0.0.0.0:8000 core.wsgi:application"]
ENTRYPOINT [ "sh","/app/docker-entrypoint.sh" ]
2 changes: 1 addition & 1 deletion src/core/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
# https://docs.djangoproject.com/en/5.1/howto/static-files/

STATIC_URL = 'static/'

STATIC_ROOT= 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field

Expand Down
4 changes: 4 additions & 0 deletions src/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!ash
python manage.py collectstatic --noinput
python manage.py migrate
gunicorn --workers=3 --bind=0.0.0.0:8000 core.wsgi:application

0 comments on commit 2e5d382

Please sign in to comment.