Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dockerfile to take env vars from .env file of dockercompose #17

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 30 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,36 @@
FROM node:16-alpine as dependencies
FROM node:14-alpine as dependencies
WORKDIR /app
COPY package.json .
RUN npm install --legacy-peer-deps
RUN npm install

FROM node:14-alpine as build
# These vars will be sourced during build time
ARG NG_APP_url
ARG NG_APP_nl_url
ARG NG_APP_nl_login_url
ARG NG_APP_nl_login_token
ARG NG_APP_nl_application_id
ARG NG_APP_blobUrl
ARG NG_APP_botPhoneNumber
ARG NG_APP_adapterId
ARG NG_APP_broadcastAdapterId
ARG NG_APP_userId
ARG NG_APP_orgId
ARG NG_APP_token

ENV NG_APP_url $NG_APP_url
ENV NG_APP_nl_url $NG_APP_nl_url
ENV NG_APP_nl_login_url $NG_APP_nl_login_url
ENV NG_APP_nl_login_token $NG_APP_nl_login_token
ENV NG_APP_nl_application_id $NG_APP_nl_application_id
ENV NG_APP_blobUrl $NG_APP_blobUrl
ENV NG_APP_botPhoneNumber $NG_APP_botPhoneNumber
ENV NG_APP_adapterId $NG_APP_adapterId
ENV NG_APP_broadcastAdapterId $NG_APP_broadcastAdapterId
ENV NG_APP_userId $NG_APP_userId
ENV NG_APP_orgId $NG_APP_orgId
ENV NG_APP_token $NG_APP_token

FROM node:16-alpine as build
WORKDIR /app
COPY . .
COPY --from=dependencies /app/node_modules ./node_modules
Expand Down