mirror of
https://github.com/jaypyles/Scraperr.git
synced 2025-12-11 18:26:08 +00:00
wip: edit Dockerfile
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -12,17 +12,6 @@ COPY ./build/ /project/app/build
|
|||||||
WORKDIR /project/app
|
WORKDIR /project/app
|
||||||
RUN pdm install
|
RUN pdm install
|
||||||
|
|
||||||
# Build js dependencies
|
|
||||||
FROM node:latest AS jsbuilder
|
|
||||||
|
|
||||||
WORKDIR /project/app
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
RUN npm install
|
|
||||||
COPY public ./public
|
|
||||||
COPY src ./src
|
|
||||||
COPY tsconfig.json tailwind.config.js ./
|
|
||||||
|
|
||||||
# Create final image
|
# Create final image
|
||||||
FROM python:3.10-slim
|
FROM python:3.10-slim
|
||||||
|
|
||||||
@@ -31,10 +20,6 @@ COPY --from=pybuilder /usr/local/lib/python3.10/site-packages /usr/local/lib/pyt
|
|||||||
COPY --from=pybuilder /usr/local/bin /usr/local/bin
|
COPY --from=pybuilder /usr/local/bin /usr/local/bin
|
||||||
COPY --from=pybuilder /project/app /project/api
|
COPY --from=pybuilder /project/app /project/api
|
||||||
|
|
||||||
COPY --from=jsbuilder /usr/local/lib/node_modules /usr/local/lib/node_modules
|
|
||||||
COPY --from=jsbuilder /usr/local/bin /usr/local/bin
|
|
||||||
COPY --from=jsbuilder /project/app /project/app
|
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
WORKDIR /project/api
|
WORKDIR /project/api
|
||||||
|
|||||||
@@ -25,3 +25,8 @@ app.mount("/static", StaticFiles(directory="./build/static"), name="static")
|
|||||||
@app.get("/")
|
@app.get("/")
|
||||||
def read_root():
|
def read_root():
|
||||||
return FileResponse("./build/index.html")
|
return FileResponse("./build/index.html")
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/api/endpoint")
|
||||||
|
async def test_endpoint():
|
||||||
|
return {"hello": "world"}
|
||||||
|
|||||||
Reference in New Issue
Block a user