-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docker file added for production env
- Loading branch information
Yujith Isura
authored and
Yujith Isura
committed
Mar 11, 2020
1 parent
d662bad
commit 9732f44
Showing
1 changed file
with
23 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM tiangolo/node-frontend:10 as builder | ||
|
||
ADD ./src /app/src | ||
COPY package*.json /app/ | ||
COPY ./public /app/public | ||
WORKDIR /app | ||
RUN npm ci | ||
ENV REACT_APP_API_BASE_URL=https://apim-gw-lgc.elections.gov.lk/nominations/0.9 | ||
ENV REACT_APP_PDF_GENARATION_SERVICE_URL=https://apim-gw-lgc.elections.gov.lk/nominations/0.9 | ||
ENV REACT_APP_AUTH_BASE_URL=https://nominations.elections.gov.lk | ||
ENV REACT_APP_NOMINATION_URL=https://nominations.elections.gov.lk | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:1.15 | ||
|
||
COPY --from=builder /app/build/ /usr/share/nginx/html | ||
COPY --from=builder /nginx.conf /etc/nginx/conf.d/default.conf | ||
WORKDIR /usr/share/nginx/html/ | ||
|
||
EXPOSE 80 | ||
CMD echo 'window._env_ = {}; window._env_.API_BASE ="'http://localhost:3000'"' > env-config.js && nginx -g 'daemon off;' | ||
|