/
Dockerfile
executable file
·52 lines (35 loc) · 950 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
41
42
43
44
45
46
47
48
49
50
51
52
FROM python:3.11-slim as base
RUN adduser --disabled-password reflex
FROM base as build
WORKDIR /app
ENV VIRTUAL_ENV=/app/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
RUN apt-get update && apt-get install -y \
git \
&& pip install wheel
COPY . .
RUN pip install --no-build-isolation gradient \
&& pip install -r requirements.txt
FROM base as runtime
RUN apt-get update && apt-get install -y \
curl \
&& curl -fsSL https://deb.nodesource.com/setup_19.x | bash - \
&& apt-get update && apt-get install -y \
nodejs \
unzip \
&& rm -rf /var/lib/apt/lists/*
ENV PATH="/app/venv/bin:$PATH"
FROM runtime as init
WORKDIR /app
ENV BUN_INSTALL="/app/.bun"
COPY --from=build /app/ /app/
RUN reflex init
FROM runtime
COPY --chown=reflex --from=init /app/ /app/
USER reflex
WORKDIR /app
ENV BUN_PATH="/app/.bun/bin/bun"
CMD ["reflex","run" , "--env", "prod"]
EXPOSE 3000
EXPOSE 8000