From 3318d22297ffbb5778593cd92c42e0da26103f80 Mon Sep 17 00:00:00 2001 From: Mathieu Strypsteen Date: Tue, 12 Mar 2024 18:33:35 +0100 Subject: [PATCH] Add dockerfiles --- backend/Dockerfile | 6 ++++++ frontend/Dockerfile | 7 +++++++ frontend/package-lock.json | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 backend/Dockerfile create mode 100644 frontend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 00000000..70d9c316 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.12-slim +EXPOSE 8000 +COPY . /backend +WORKDIR /backend +RUN pip install -r requirements.txt +CMD uvicorn --host 0.0.0.0 app:app diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 00000000..10c3e15a --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,7 @@ +FROM node:20 AS builder +COPY . /app +WORKDIR /app +RUN npm install +RUN npm run build +FROM nginx +COPY --from=builder /app/dist /usr/share/nginx/html diff --git a/frontend/package-lock.json b/frontend/package-lock.json index f396b81c..721f50cd 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -27,6 +27,9 @@ "eslint-plugin-react-refresh": "^0.4.5", "typescript": "^5.2.2", "vite": "^5.1.4" + }, + "engines": { + "node": "^20.0.0" } }, "node_modules/@aashutoshrathi/word-wrap": {