-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (30 loc) · 864 Bytes
/
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
# Use an official Python runtime as a base image
FROM python:3.11
# Install Node.js
RUN apt-get update && \
apt-get install -y curl gnupg && \
curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
apt-get install -y nodejs && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy backend files
COPY backend/ ./backend/
# Copy frontend files
COPY frontend/ ./frontend/
# Copy env files if they exist
COPY --chown=root:root .env* ./
# Install backend dependencies
RUN pip install --no-cache-dir -r backend/requirements.txt
# Install frontend dependencies and build
RUN cd frontend && \
npm install && \
npm run build
# Expose the port 3000 to the outside
EXPOSE 3000
# Copy the start script
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Start both servers
CMD ["/start.sh"]