-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 1.02 KB
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 1.02 KB
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
# Use an official Python runtime as a parent image
FROM python:3.12-slim
# Set the working directory in the container
WORKDIR /app
# Copy the backend requirements file into the container
COPY app/requirements.txt .
# Install backend dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the backend source code into the container
COPY app/ .
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Install Node.js
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs
# Set the working directory for the frontend
WORKDIR /askpod
# Copy the frontend package.json and package-lock.json into the container
COPY askpod/package*.json ./
# Install frontend dependencies
RUN npm install
# Copy the frontend source code into the container
COPY askpod/ .
# Expose the ports
EXPOSE 8000 3000
# Command to run both the FastAPI server and Next.js development server
CMD ["sh", "-c", "cd /app && fastapi run & cd /askpod && npm run dev"]