From db3b07e8e0f9f2e57bf8c73d3334f7cfe957b072 Mon Sep 17 00:00:00 2001 From: Alberto Xamin Date: Sat, 21 Nov 2020 17:37:42 +0100 Subject: [PATCH] add docker --- backend/Dockerfile | 8 ++++++++ frontend/Dockerfile | 22 ++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 backend/Dockerfile create mode 100644 frontend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 0000000..515c7b6 --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,8 @@ +FROM python:3.7-slim-stretch + +WORKDIR /code +COPY * /code/ +RUN pip install -r requirements.txt +EXPOSE 5001 + +ENTRYPOINT ["python", "/code/__init__.py"] \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..e047020 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,22 @@ +FROM node:lts-alpine + +# install simple http server for serving static content +RUN npm install -g http-server + +# make the 'app' folder the current working directory +WORKDIR /app + +# copy both 'package.json' and 'package-lock.json' (if available) +COPY package*.json ./ + +# install project dependencies +RUN npm install + +# copy project files and folders to the current working directory (i.e. 'app' folder) +COPY . . + +# build app for production with minification +RUN npm run build + +EXPOSE 8080 +CMD [ "http-server", "dist" ] \ No newline at end of file