sfun commited on
Commit
07a8bc0
1 Parent(s): 3509d3c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -15
Dockerfile CHANGED
@@ -1,17 +1,10 @@
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
 
@@ -21,11 +14,10 @@ ENV PYTHONPATH=/project/pkgs
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
- COPY entrypoint.sh /
27
 
28
  EXPOSE 3000
29
 
30
- # set command/entrypoint, adapt to fit your needs
31
- ENTRYPOINT sh /entrypoint.sh
 
1
  # build stage
2
+ FROM ghcr.io/yufeikang/raycast_api_proxy:main AS builder
 
 
 
 
 
 
 
 
 
3
 
4
  # run stage
5
+ FROM FROM --platform=$BUILDPLATFORM caddy:alpine AS runner
6
+
7
+ RUN apk add --no-cache python3 py3-pip
8
 
9
  WORKDIR /project
10
 
 
14
  RUN chmod 777 -R /project
15
  RUN mkdir -p ./sync && chmod 777 -R ./sync
16
 
17
+ COPY --from=builder /project/pkgs /project/pkgs
18
  COPY --from=builder /project/app /project/app
19
+ COPY Caddyfile ./Caddyfile
20
 
21
  EXPOSE 3000
22
 
23
+ CMD ["sh", "-c", "caddy run --config /app/Caddyfile & python -m uvicorn app.main:app --host 0.0.0.0 --port 80"]