-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.frontend
41 lines (28 loc) · 1.01 KB
/
Dockerfile.frontend
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
FROM python:3.9-slim as init
WORKDIR /app/trainr
COPY trainr/frontend frontend
COPY trainr/utils.py .
COPY requirements-frontend.txt requirements.txt
ENV VIRTUAL_ENV=/app/trainr/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONPATH=$VIRTUAL_ENV:/app
WORKDIR /app/trainr/frontend
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash - && \
apt-get update && apt-get upgrade -y && apt-get install -y gcc python3-dev unzip curl && \
rm -rf /var/lib/apt/lists/* && \
python3.9 -m venv $VIRTUAL_ENV && pip install -r ../requirements.txt && \
reflex init && reflex export --frontend-only --no-zip
FROM python:3.9-slim
ARG API_URL=http://localhost:3000
WORKDIR /app/trainr
ENV VIRTUAL_ENV=/app/trainr/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONPATH=$VIRTUAL_ENV:/app
COPY --from=init /app /app
WORKDIR /app/trainr/frontend
RUN apt-get update && \
apt-get upgrade && \
apt-get install -y nodejs unzip curl && \
rm -rf /var/lib/apt/lists/* && \
reflex init
CMD ["reflex", "run"]