forked from hoangsonww/The-MovieVerse-Database
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (34 loc) · 1.05 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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
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 MovieVerse-Backend/requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt
# ---- Copy Backend Code ----
FROM python-base AS backend-code
COPY MovieVerse-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"]