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 +