From 9202b473f579c50f9a0b269ee2ef9530cd690d2c Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sun, 20 Dec 2020 18:09:58 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=B3=20move=20to=20new=20+=20simple=20D?= =?UTF-8?q?ockerfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 16 +++++++++++----- docker-compose.yml | 9 ++++----- env.sample.js | 5 +++++ 3 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 env.sample.js diff --git a/Dockerfile b/Dockerfile index 70c2f4b4..b20271d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,12 @@ +FROM node:15.4.0-alpine3.12 +WORKDIR /app +RUN npm i -g pnpm +COPY package.json index.html ./ +RUN pnpm i +COPY src ./src +COPY public ./public +RUN pnpm run build +# final image FROM fholzer/nginx-brotli:v1.19.1 -ENV APP_CONF="config={}" -# TODO: buildstep -COPY ./dist /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf.template -# COPY ./nginx.conf /etc/nginx/nginx.conf \ No newline at end of file +COPY --from=0 /app/dist /usr/share/nginx/html +COPY ./nginx.conf /etc/nginx/nginx.conf \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index c9178493..9ee12da9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,8 @@ -version: '3' +version: "3" services: httpd: build: . - environment: - - APP_CONF=config={"baseUrl":"http://localhost:8081"} - command: ["sh", "-c", "envsubst < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && nginx -g 'daemon off;'"] + volumes: + - ./dev.env.js:/usr/share/nginx/html/env.js ports: - - 4050:80 \ No newline at end of file + - 4050:80 diff --git a/env.sample.js b/env.sample.js new file mode 100644 index 00000000..6e67035f --- /dev/null +++ b/env.sample.js @@ -0,0 +1,5 @@ +const config = { + baseurl: 'https://dev.lauf-fuer-kaya.de', + fallback_username: 'admin', + fallback_password: '72fpTzsev4xUu78QPs2FCbwZ3' +};