-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (56 loc) · 1.6 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (56 loc) · 1.6 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Build stage for React app
FROM node:20-alpine AS frontend-build
WORKDIR /app
# Install bash (required for prebuild scripts)
RUN apk add --no-cache bash
# Copy package files
COPY package*.json ./
COPY scripts ./scripts
RUN npm install
# Copy source code
COPY src ./src
COPY public ./public
COPY index.html ./
COPY vite.config.js ./
COPY tailwind.config.js ./
COPY postcss.config.js ./
# Build arguments for Vite environment variables
ARG VITE_STRIPE_PUBLISHABLE_KEY
ENV VITE_STRIPE_PUBLISHABLE_KEY=$VITE_STRIPE_PUBLISHABLE_KEY
# Build the React app (skip prebuild verification in Docker)
RUN npm run build:skip-verify
# Python backend stage
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
curl \
docker.io \
pciutils \
postgresql-client \
unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install rclone
RUN curl https://rclone.org/install.sh | bash
WORKDIR /app
# Install Python dependencies
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/*.py ./
COPY backend/routers ./routers
COPY backend/middleware ./middleware
COPY backend/atlas ./atlas
COPY backend/models ./models
COPY backend/database ./database
COPY backend/services ./services
COPY backend/alembic ./alembic
COPY backend/alembic.ini ./alembic.ini
# Copy built React app from frontend stage
COPY --from=frontend-build /app/dist ./dist
# Copy public files (including login.html)
COPY public ./public
# Expose port
EXPOSE 8084
# Run the server
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8084"]