diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..2781d5087ca5e2976d0e4641de1d7c3c9d86c659 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM node:lts-alpine as build-stage + +# 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 . . +RUN npm run build + +# production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist/assets /usr/share/nginx/html/quiver-frontend/assets +COPY --from=build-stage /app/dist/index.html /usr/share/nginx/html/index.html diff --git a/README.md b/README.md index 885e5ac694e47a390c41c399916cf2687771efb0..4c648ee8700cdd93ad01e3eca8ca794bd3908962 100644 --- a/README.md +++ b/README.md @@ -29,3 +29,17 @@ npm run build ```sh npm run lint ``` + +## Project Setup with Docker + +Build the Docker image: + +```sh +docker build -t qfa . +``` + +Run a container based on this image: + +```sh +docker run --rm -d --name qfa-server -p 8083:80 qfa +```