-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (31 loc) · 814 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
FROM python:3.11-slim as base
RUN adduser --disabled-password pynecone
FROM base as build
WORKDIR /app
ENV VIRTUAL_ENV=/app/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY . .
RUN pip install wheel \
&& 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 pc init
FROM runtime
COPY --chown=pynecone --from=init /app/ /app/
USER pynecone
WORKDIR /app
CMD ["pc","run" , "--env", "prod"]
EXPOSE 3000
EXPOSE 8000