update Dockerfile and settings for static files handling; adjust nginx config for Django and Vue integration
This commit is contained in:
@@ -42,11 +42,14 @@ COPY --from=builder /usr/local/bin/ /usr/local/bin/
|
||||
# Copy application code with ownership
|
||||
COPY --chown=appuser:appuser . .
|
||||
|
||||
# Collect static files
|
||||
RUN python manage.py collectstatic --noinput
|
||||
|
||||
# Switch to non-root user
|
||||
USER appuser
|
||||
|
||||
# Expose Django port
|
||||
EXPOSE 7080
|
||||
EXPOSE 7090
|
||||
|
||||
# Run Django with uvicorn
|
||||
CMD ["uvicorn", "MPM:application", "--host", "0.0.0.0", "--port", "7080"]
|
||||
CMD ["uvicorn", "MPM:application", "--host", "0.0.0.0", "--port", "7090"]
|
||||
|
||||
@@ -122,6 +122,11 @@ USE_TZ = True
|
||||
# https://docs.djangoproject.com/en/5.2/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||
|
||||
# Proxy settings
|
||||
USE_X_FORWARDED_HOST = True
|
||||
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.2/ref/settings/#default-auto-field
|
||||
|
||||
Reference in New Issue
Block a user