31 lines
467 B
Plaintext
31 lines
467 B
Plaintext
# Stage 1: Build React Frontend
|
|
FROM node AS frontend-build
|
|
|
|
WORKDIR /frontend
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build
|
|
|
|
# Stage 2: Build Django Backend
|
|
FROM python:3.10
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
WORKDIR /code
|
|
|
|
COPY requirements.txt ./
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . /code/
|
|
|
|
# Stage 3: Combine React and Django
|
|
COPY --from=frontend-build /frontend/build /code/frontend/build
|
|
|
|
EXPOSE 3000 8000
|
|
|
|
CMD ["./start.sh"]
|