File size: 1,170 Bytes
85b09a4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9383bfc
ae4e258
9383bfc
 
ae4e258
9383bfc
 
ae4e258
85b09a4
9383bfc
 
ae4e258
85b09a4
 
ae4e258
85b09a4
 
9383bfc
85b09a4
 
 
9383bfc
85b09a4
 
ae4e258
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
42
43
44
45
46
47
48
# Use an official Python runtime as a parent image
FROM python:3.9-slim AS backend

# Set the working directory for the backend in the container
WORKDIR /app

# Install system dependencies
RUN apt-get update \
        && apt-get install -y --no-install-recommends gcc \
        && rm -rf /var/lib/apt/lists/*

# Copy backend application dependencies
COPY requirements.txt /app/
RUN pip install --no-cache-dir -r requirements.txt

# Copy all backend source code from the root directory
COPY . /app/

# Expose the port the backend app runs on
EXPOSE 5000

# Build frontend
FROM node:14 AS frontend

# Set the working directory for the frontend in the container
WORKDIR /app/frontend

# Copy frontend source code
COPY frontend /app/frontend

# Install frontend dependencies and build
RUN npm install
RUN npm run build

# Merge frontend build with backend
FROM backend AS final

# Copy built frontend files to appropriate location for serving
COPY --from=frontend /app/frontend/dist /app/frontend/dist

# Add configuration to serve frontend files using Nginx
# Example:
# COPY nginx.conf /etc/nginx/nginx.conf

# Start the backend server
CMD ["python", "together_call.py"]