From 2d864dd57ff23b6bff2308c49490af549918a475 Mon Sep 17 00:00:00 2001 From: penner Date: Sat, 16 Sep 2023 21:57:19 +0000 Subject: [PATCH] DockerImage --- .dockerignore | 27 +++++++++++++++++++++++++++ Dockerfile | 18 ++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3d87bc6 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,27 @@ +# commonly found +**/.git +**/.idea +**/.DS_Store +**/.vscode +**/.devcontainer + +**/dist +**/.gitignore +**/Dockerfile +**/.dockerignore + +# found in python and JS dirs +**/__pycache__ +**/node_modules +**/.pytest_cache + +# env files +**/.env +**/.env.local +**/.env.*.local + +# log files +**/npm-debug.log* +**/yarn-debug.log* +**/yarn-error.log* +**/pnpm-debug.log* \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fbd4b79 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:lts AS uibuild +WORKDIR /usr/src/app +COPY ui/package*.json ui/yarn*.lock ./ +RUN yarn --production=false +COPY ui ./ +RUN yarn build + +FROM tiangolo/uvicorn-gunicorn:python3.11-slim +WORKDIR /usr/src/app + +ENV \ +PRODUCTION_MODE="true" \ +APP_MODULE="advent22_api.app:app" + +COPY api ./ +RUN python -m pip --no-cache-dir install ./ +COPY --from=uibuild /usr/src/app/dist /html +