From beb9ac6741e8f79a3811549f1ce048cc5c8fe617 Mon Sep 17 00:00:00 2001 From: windsnow1025 Date: Sun, 13 Oct 2024 08:30:41 -0700 Subject: [PATCH] build: improve docker build --- fastapi/.dockerignore | 1 + fastapi/.gitignore | 2 +- fastapi/Dockerfile | 8 +++----- ....json.example => http-client.private.env.example.json} | 0 nest/.dockerignore | 1 + next/.dockerignore | 8 ++------ 6 files changed, 8 insertions(+), 12 deletions(-) rename fastapi/test/{http-client.private.env.json.example => http-client.private.env.example.json} (100%) diff --git a/fastapi/.dockerignore b/fastapi/.dockerignore index c2dfc2b1..7d7f53db 100644 --- a/fastapi/.dockerignore +++ b/fastapi/.dockerignore @@ -1,3 +1,4 @@ .idea __pycache__ +test .env \ No newline at end of file diff --git a/fastapi/.gitignore b/fastapi/.gitignore index b2cb89b7..92d28194 100644 --- a/fastapi/.gitignore +++ b/fastapi/.gitignore @@ -1,4 +1,4 @@ .idea __pycache__ .env -*.env.json \ No newline at end of file +http-client.private.env.json \ No newline at end of file diff --git a/fastapi/Dockerfile b/fastapi/Dockerfile index 44d037c3..b11c0a35 100644 --- a/fastapi/Dockerfile +++ b/fastapi/Dockerfile @@ -2,12 +2,10 @@ FROM python:3.12 WORKDIR /code -COPY ./requirements.txt /code/requirements.txt +COPY requirements.txt ./ -RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt +RUN pip install --no-cache-dir --upgrade -r ./requirements.txt -COPY ./app /code/app -COPY ./resources /code/resources -COPY ./chat /code/chat +COPY . . CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"] diff --git a/fastapi/test/http-client.private.env.json.example b/fastapi/test/http-client.private.env.example.json similarity index 100% rename from fastapi/test/http-client.private.env.json.example rename to fastapi/test/http-client.private.env.example.json diff --git a/nest/.dockerignore b/nest/.dockerignore index 4e99aeae..f59892ff 100644 --- a/nest/.dockerignore +++ b/nest/.dockerignore @@ -1,4 +1,5 @@ .idea +.run dist node_modules test diff --git a/next/.dockerignore b/next/.dockerignore index 72e9aa42..2c89cf4c 100644 --- a/next/.dockerignore +++ b/next/.dockerignore @@ -1,7 +1,3 @@ -Dockerfile -.dockerignore -node_modules -npm-debug.log -README.md +.idea .next -.git \ No newline at end of file +node_modules \ No newline at end of file