File tree Expand file tree Collapse file tree 3 files changed +7
-13
lines changed
Expand file tree Collapse file tree 3 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ COPY . .
1313RUN npm run build
1414
1515# Keep only static build artifacts to reduce image size
16- RUN rm -rf node_modules package*.json apecs/*/static/*
16+ RUN rm -rf node_modules package*.json
1717
1818# ------------------ STAGE 2: Python / Django ------------------
1919FROM python:3.13-slim AS python
@@ -36,7 +36,7 @@ ENV PATH="$POETRY_HOME/bin:$PATH"
3636RUN curl -sSL https://install.python-poetry.org | python3 -
3737
3838# ------------------ Copy Node build artifacts first ------------------
39- COPY --from=static --chown=apecsuser /usr/src/apecs/apecs/*/ static ./apecs/
39+ COPY --from=static --chown=apecsuser /usr/src/apecs/apecs/static ./apecs/static /
4040
4141# Copy project metadata and install Python dependencies
4242COPY pyproject.toml poetry.lock ./
Original file line number Diff line number Diff line change 170170MEDIA_ROOT = BASE_DIR / 'mediafiles'
171171
172172STATIC_ROOT = os .path .join (BASE_DIR , 'static/whitenoise' )
173- STATIC_URL = 'static/'
173+ STATIC_URL = '/ static/'
174174STATICFILES_DIRS = [BASE_DIR / "static/dist" ]
175175
176176# Default primary key field type
Original file line number Diff line number Diff line change 1- """
2- WSGI config for apecs project.
3-
4- It exposes the WSGI callable as a module-level variable named ``application``.
5-
6- For more information on this file, see
7- https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
8- """
9-
101import os
11-
122from django .core .wsgi import get_wsgi_application
3+ from whitenoise import WhiteNoise
134
145os .environ .setdefault ('DJANGO_SETTINGS_MODULE' , 'apecs.settings.dev' )
156
167application = get_wsgi_application ()
8+
9+ STATIC_ROOT = os .path .join (os .path .dirname (__file__ ), 'static/whitenoise' )
10+ application = WhiteNoise (application , root = STATIC_ROOT )
You can’t perform that action at this time.
0 commit comments