From f507154687463504c37f484089ef99ad5bd80cfa Mon Sep 17 00:00:00 2001 From: Julian Matschinske <julian.matschinske@wzw.tum.de> Date: Sat, 28 Mar 2020 20:03:49 +0100 Subject: [PATCH] Add Dockerfile and nginx config --- Dockerfile | 25 +++++++++++++++++++++++++ nginx/default.conf | 11 +++++++++++ 2 files changed, 36 insertions(+) create mode 100644 Dockerfile create mode 100644 nginx/default.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..29fc33d1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +FROM nginx + +RUN apt-get update +RUN apt-get install -y curl + +RUN curl -sL https://deb.nodesource.com/setup_10.x | bash + +RUN apt-get install -y nodejs + +COPY package.json /app/ +COPY package-lock.json /app/ + +WORKDIR /app/ + +RUN npm install + +COPY . /app/ + +RUN npm run build -- --prod --base-href=/covid19/ + +RUN cp -r dist/covid19/* /usr/share/nginx/html/ + +COPY nginx/default.conf /etc/nginx/conf.d/ + +EXPOSE 80 diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 00000000..3683d12f --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,11 @@ +server { + listen 80; + server_name localhost; + + index index.html; + root /usr/share/nginx/html; + + location / { + try_files $uri$args $uri$args/ /index.html; + } +} -- GitLab