-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rewrite Dockerfile to use nginx unprivilege
- Loading branch information
Showing
4 changed files
with
21 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,77 +1,22 @@ | ||
FROM node:12-alpine as builder | ||
|
||
ENV WORKDIR /home/app | ||
WORKDIR $WORKDIR | ||
WORKDIR /app | ||
|
||
RUN apk update && apk add git yarn | ||
RUN apk add --no-cache git | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
|
||
RUN yarn install --network-timeout 1000000 | ||
COPY package.json yarn.lock . | ||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
ARG VUE_APP_API_BASE_URL | ||
ARG VUE_APP_BOTHUB_NLP_BASE_URL | ||
ARG VUE_APP_BOTHUB_WEBAPP_BASE_URL | ||
ARG VUE_APP_SUPPORTED_LANGUAGES | ||
ARG VUE_APP_MAILCHIMP_LOGIN | ||
ARG VUE_APP_MAILCHIMP_DATACENTER | ||
ARG VUE_APP_MAILCHIMP_USER_ID | ||
ARG VUE_APP_MAILCHIMP_LIST_ID | ||
ARG VUE_APP_VERSION_ENABLED | ||
ARG VUE_APP_BOTHUB_WEBAPP_USE_SENTRY | ||
ARG VUE_APP_BOTHUB_WEBAPP_SENTRY | ||
ARG VUE_APP_BOTHUB_WEBAPP_USE_HOTJAR | ||
ARG VUE_APP_BOTHUB_WEBAPP_HOTJAR_ID | ||
ARG VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_KEY | ||
ARG VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_ALGORITHM_ARTICLE_ID | ||
ARG VUE_APP_BOTHUB_WEBAPP_PAYMENT_ENABLED | ||
ARG VUE_APP_BOTHUB_WEBAPP_TUTORIAL_ENABLED | ||
ARG VUE_APP_HELPHERO_ID | ||
ARG VUE_APP_HELPHERO_TOUR | ||
ARG VUE_APP_QA_FLOW_CHANNEL | ||
ARG VUE_APP_LOGROCKET_ID | ||
ARG VUE_APP_LOGROCKET_PARENT_DOMAIN | ||
ARG SENTRY_ENVIRONMENT | ||
|
||
ENV VUE_APP_API_BASE_URL "${VUE_APP_API_BASE_URL}" | ||
ENV VUE_APP_BOTHUB_NLP_BASE_URL "${VUE_APP_BOTHUB_NLP_BASE_URL}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_BASE_URL "${VUE_APP_BOTHUB_WEBAPP_BASE_URL}" | ||
ENV VUE_APP_SUPPORTED_LANGUAGES "${VUE_APP_SUPPORTED_LANGUAGES}" | ||
ENV VUE_APP_MAILCHIMP_LOGIN "${VUE_APP_MAILCHIMP_LOGIN}" | ||
ENV VUE_APP_MAILCHIMP_DATACENTER "${VUE_APP_MAILCHIMP_DATACENTER}" | ||
ENV VUE_APP_MAILCHIMP_USER_ID "${VUE_APP_MAILCHIMP_USER_ID}" | ||
ENV VUE_APP_MAILCHIMP_LIST_ID "${VUE_APP_MAILCHIMP_LIST_ID}" | ||
ENV VUE_APP_VERSION_ENABLED "${VUE_APP_VERSION_ENABLED}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_USE_SENTRY "${VUE_APP_BOTHUB_WEBAPP_USE_SENTRY}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_SENTRY "${VUE_APP_BOTHUB_WEBAPP_SENTRY}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_USE_HOTJAR "${VUE_APP_BOTHUB_WEBAPP_USE_HOTJAR}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_HOTJAR_ID "${VUE_APP_BOTHUB_WEBAPP_HOTJAR_ID}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_KEY "${VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_KEY}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_ALGORITHM_ARTICLE_ID "${VUE_APP_BOTHUB_WEBAPP_LIGHTHOUSE_ALGORITHM_ARTICLE_ID}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_PAYMENT_ENABLED "${VUE_APP_BOTHUB_WEBAPP_PAYMENT_ENABLED}" | ||
ENV VUE_APP_BOTHUB_WEBAPP_TUTORIAL_ENABLED "${VUE_APP_BOTHUB_WEBAPP_TUTORIAL_ENABLED}" | ||
ENV VUE_APP_HELPHERO_ID "${VUE_APP_HELPHERO_ID}" | ||
ENV VUE_APP_HELPHERO_TOUR "${VUE_APP_HELPHERO_TOUR}" | ||
ENV VUE_APP_QA_FLOW_CHANNEL "${VUE_APP_QA_FLOW_CHANNEL}" | ||
ENV VUE_APP_LOGROCKET_ID "${VUE_APP_LOGROCKET_ID}" | ||
ENV VUE_APP_LOGROCKET_PARENT_DOMAIN "${VUE_APP_LOGROCKET_PARENT_DOMAIN}" | ||
ENV SENTRY_ENVIRONMENT "${SENTRY_ENVIRONMENT}" | ||
|
||
RUN yarn build | ||
|
||
FROM nginx | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder /home/app/dist /usr/share/nginx/html/bothub-webapp | ||
FROM nginxinc/nginx-unprivileged:1.25 | ||
|
||
COPY --chown=nginx:root nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder --chown=nginx:nginx /app/dist /app/config.js.tmpl /usr/share/nginx/html/bothub-webapp | ||
COPY docker-entrypoint.sh / | ||
|
||
EXPOSE 8080 | ||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
|
||
COPY config.js.tmpl /usr/share/nginx/html/bothub-webapp/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters