smgc commited on
Commit
e3f2070
1 Parent(s): b586892

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ RUN git clone https://github.com/yufeikang/raycast_api_proxy.git .
9
+
10
+ # copy files
11
+ COPY pyproject.toml pdm.lock README.md /project/
12
+
13
+ # install dependencies and project into the local packages directory
14
+ WORKDIR /project
15
+ RUN mkdir __pypackages__ && pdm install --prod --no-lock --no-editable
16
+
17
+ # run stage
18
+ FROM python:3.10-slim
19
+
20
+ # retrieve packages from build stage
21
+ ENV PYTHONPATH=/project/pkgs
22
+ COPY --from=builder /project/__pypackages__/3.10/lib /project/pkgs
23
+ COPY --from=builder /app /project/app
24
+ COPY --from=builder /scripts/entrypoint.sh /
25
+
26
+ RUN sed -i'' 's|--port 80|--port 8000|g' /entrypoint.sh
27
+
28
+
29
+ EXPOSE 8000
30
+
31
+ WORKDIR /project
32
+ # set command/entrypoint, adapt to fit your needs
33
+ ENTRYPOINT sh /entrypoint.sh