-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (35 loc) · 1.26 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (35 loc) · 1.26 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
FROM node:20-bookworm-slim AS ui-builder
WORKDIR /build/admin-ui
COPY admin-ui/package.json admin-ui/package-lock.json ./
RUN npm ci
COPY admin-ui/index.html ./
COPY admin-ui/tsconfig.json ./
COPY admin-ui/tsconfig.app.json ./
COPY admin-ui/vite.config.ts ./
COPY admin-ui/src ./src
RUN npm run build
FROM python:3.12-slim
ARG TARGETARCH
ENV PYTHONUNBUFFERED=1 \
DATABASE_TYPE=sqlite \
DATABASE_PATH=/data/girlchat.db \
SERVER_HOST=0.0.0.0 \
SERVER_PORT=8000
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends curl ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN case "${TARGETARCH}" in \
"amd64") cloudflared_arch="amd64" ;; \
"arm64") cloudflared_arch="arm64" ;; \
*) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; \
esac \
&& curl -fsSL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-${cloudflared_arch}" -o /usr/local/bin/cloudflared \
&& chmod +x /usr/local/bin/cloudflared
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY app ./app
COPY --from=ui-builder /build/admin-ui/dist ./admin-ui/dist
RUN mkdir -p /data
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]