-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (38 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
52 lines (38 loc) · 1.14 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
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:20-alpine AS frontend-build
WORKDIR /frontend
COPY client/package*.json ./
RUN npm ci
COPY client/ ./
ARG VITE_API_BASE_URL=/api/v1
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
RUN npm run build
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
libcairo2 \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libgdk-pixbuf-2.0-0 \
libffi-dev \
shared-mime-info \
git \
&& rm -rf /var/lib/apt/lists/*
# Install python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application
COPY . .
# Copy the production frontend build into the backend image. This lets single
# web-service deployments, such as DigitalOcean App Platform Dockerfile deploys,
# serve the React frontend and the FastAPI API from the same container.
COPY --from=frontend-build /frontend/dist ./client/dist
# Expose port
EXPOSE 8000
ENV ENVIRONMENT=production \
DEBUG=false \
ANALYSIS_WORKER_EMBEDDED=true
# Default command
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]