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..15d90550 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: + - ./public/env.sample.js:/usr/share/nginx/html/env.js ports: - - 4050:80 \ No newline at end of file + - 4050:80