-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #355 from weni-ai/feat/new-dockerfile
New dockerfile for enhanced security
- Loading branch information
Showing
3 changed files
with
25 additions
and
42 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,48 +1,25 @@ | ||
FROM node:14.17.4-alpine3.14 as builder | ||
|
||
ENV WORKDIR /app | ||
WORKDIR $WORKDIR | ||
WORKDIR /app | ||
|
||
RUN apk update && apk add git yarn | ||
|
||
COPY package.json . | ||
COPY yarn.lock . | ||
RUN apk add --no-cache git | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install | ||
|
||
COPY . . | ||
|
||
ARG VUE_APP_API_BASE_URL | ||
ARG VUE_APP_USE_SENTRY | ||
ARG VUE_APP_SENTRY_DSN | ||
ARG VUE_APP_FACEBOOK_APP_ID | ||
ARG VUE_APP_WHATSAPP_FACEBOOK_APP_ID | ||
ARG VUE_APP_LOGROCKET_ID | ||
ARG VUE_APP_PARENT_IFRAME_DOMAIN | ||
ARG VUE_APP_HELPHERO_ID | ||
ARG VUE_APP_FLOWS_IFRAME_URL | ||
|
||
ENV VUE_APP_API_BASE_URL $VUE_APP_API_BASE_URL | ||
ENV VUE_APP_USE_SENTRY $VUE_APP_USE_SENTRY | ||
ENV VUE_APP_SENTRY_DSN $VUE_APP_SENTRY_DSN | ||
ENV VUE_APP_FACEBOOK_APP_ID $VUE_APP_FACEBOOK_APP_ID | ||
ENV VUE_APP_WHATSAPP_FACEBOOK_APP_ID $VUE_APP_WHATSAPP_FACEBOOK_APP_ID | ||
ENV VUE_APP_LOGROCKET_ID $VUE_APP_LOGROCKET_ID | ||
ENV VUE_APP_PARENT_IFRAME_DOMAIN $VUE_APP_PARENT_IFRAME_DOMAIN | ||
ENV VUE_APP_HELPHERO_ID $VUE_APP_HELPHERO_ID | ||
ENV VUE_APP_FLOWS_IFRAME_URL $VUE_APP_FLOWS_IFRAME_URL | ||
COPY . ./ | ||
|
||
RUN yarn build | ||
|
||
FROM nginx | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder /app/dist /usr/share/nginx/html/integrations | ||
|
||
COPY docker-entrypoint.sh /usr/share/nginx/ | ||
|
||
RUN chmod +x /usr/share/nginx/docker-entrypoint.sh | ||
FROM nginxinc/nginx-unprivileged:1.25 | ||
|
||
ENTRYPOINT ["/usr/share/nginx/docker-entrypoint.sh"] | ||
COPY --chown=nginx:nginx nginx.conf /etc/nginx/nginx.conf | ||
COPY --from=builder --chown=nginx:nginx /app/dist /usr/share/nginx/html/integrations/ | ||
COPY docker-entrypoint.sh / | ||
RUN mv /usr/share/nginx/html/integrations/index.html /usr/share/nginx/html/integrations/index.html.tmpl \ | ||
&& cd /usr/share/nginx/html/integrations/ \ | ||
&& ln -s /tmp/index.html | ||
|
||
CMD ["nginx", "-g", "daemon off;"] | ||
EXPOSE 8080 | ||
ENTRYPOINT ["bash","/docker-entrypoint.sh"] | ||
CMD ["nginx", "-g", "daemon off;"] |
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