-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update: Enhanced UI layout & design (#111)
- Loading branch information
1 parent
fed2a40
commit 8ce23a5
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# ---- Base Node ---- | ||
FROM node:14 AS base | ||
WORKDIR /app | ||
COPY package*.json ./ | ||
|
||
# ---- Dependencies ---- | ||
FROM base AS dependencies | ||
RUN npm set progress=false && npm config set depth 0 | ||
RUN npm install --only=production | ||
COPY . . | ||
RUN npm run build | ||
|
||
# ---- Copy Frontend Artifacts ---- | ||
# Separate stage for extracting frontend build artifacts | ||
FROM dependencies AS frontend-artifacts | ||
RUN mkdir -p /app/public | ||
RUN cp -R build/ /app/public/ | ||
|
||
# ---- Python Base ---- | ||
FROM python:3.8 AS python-base | ||
WORKDIR /app | ||
COPY --from=frontend-artifacts /app/public /app/public | ||
COPY backend/requirements.txt /app/ | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
# ---- Copy Backend Code ---- | ||
FROM python-base AS backend-code | ||
COPY backend /app | ||
|
||
# ---- Release with Gunicorn ---- | ||
FROM backend-code AS release | ||
# Set environment variables | ||
ENV PYTHONUNBUFFERED=1 \ | ||
PYTHONDONTWRITEBYTECODE=1 \ | ||
PATH="/app:${PATH}" | ||
|
||
# Expose port for the backend | ||
EXPOSE 8080 | ||
|
||
# Start Gunicorn | ||
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "--workers", "3", "--threads", "3", "TheMovieVerseApp.wsgi:application"] |