Update Dockerfile
Browse files- Dockerfile +13 -17
Dockerfile
CHANGED
@@ -1,33 +1,29 @@
|
|
1 |
# build stage
|
2 |
-
FROM
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
6 |
|
7 |
-
#
|
8 |
-
|
|
|
|
|
9 |
|
10 |
-
#
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
RUN /venv/bin/pip install grpcio
|
15 |
|
16 |
-
# Set the virtual environment as the default Python environment
|
17 |
-
ENV PATH="/venv/bin:$PATH"
|
18 |
-
|
19 |
# retrieve packages from build stage
|
20 |
ENV PYTHONPATH=/project/pkgs
|
21 |
|
22 |
-
WORKDIR /project
|
23 |
-
|
24 |
RUN chmod 777 -R /project
|
25 |
RUN mkdir -p ./sync && chmod 777 -R ./sync
|
26 |
|
27 |
-
COPY --from=builder /project/
|
28 |
COPY --from=builder /project/app /project/app
|
29 |
-
COPY Caddyfile ./Caddyfile
|
30 |
|
31 |
EXPOSE 3000
|
32 |
|
33 |
-
CMD ["sh", "-c", "
|
|
|
1 |
# build stage
|
2 |
+
FROM python:3.10 AS builder
|
3 |
|
4 |
+
# install PDM
|
5 |
+
RUN pip install -U pip setuptools wheel
|
6 |
+
RUN pip install pdm
|
7 |
|
8 |
+
# install dependencies and project into the local packages directory
|
9 |
+
WORKDIR /project
|
10 |
+
RUN git clone https://github.com/yufeikang/raycast_api_proxy.git .
|
11 |
+
RUN mkdir __pypackages__ && pdm install --prod --no-lock --no-editable
|
12 |
|
13 |
+
# run stage
|
14 |
+
FROM python:3.10-slim
|
15 |
|
16 |
+
WORKDIR /project
|
|
|
17 |
|
|
|
|
|
|
|
18 |
# retrieve packages from build stage
|
19 |
ENV PYTHONPATH=/project/pkgs
|
20 |
|
|
|
|
|
21 |
RUN chmod 777 -R /project
|
22 |
RUN mkdir -p ./sync && chmod 777 -R ./sync
|
23 |
|
24 |
+
COPY --from=builder /project/__pypackages__/3.10/lib /project/pkgs
|
25 |
COPY --from=builder /project/app /project/app
|
|
|
26 |
|
27 |
EXPOSE 3000
|
28 |
|
29 |
+
CMD ["sh", "-c", "python -m uvicorn app.main:app --host 0.0.0.0 --port 3000"]
|