wip: edit Dockerfile

This commit is contained in:
Jayden Pyles
2024-05-18 22:14:06 -05:00
parent 20d1a26881
commit 875bce55c4
2 changed files with 5 additions and 15 deletions

View File

@@ -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

View File

@@ -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"}