[op-65] deployment docker image (#122)
parent
2dc2d9400a
commit
a158710efa
@ -1,34 +0,0 @@ |
||||
FROM node:10 as builder |
||||
|
||||
# Set NODE_ENV to production |
||||
ENV NODE_ENV production |
||||
|
||||
RUN mkdir -p /usr/src/app |
||||
WORKDIR /usr/src/app |
||||
|
||||
# Install dependencies |
||||
COPY package.json package-lock.json /usr/src/app/ |
||||
RUN npm install |
||||
|
||||
# Copy source scripts |
||||
COPY . /usr/src/app |
||||
|
||||
# Build react SPA bundle |
||||
RUN GENERATE_SOURCEMAP=false npm run build |
||||
|
||||
FROM nginx:1.15-alpine |
||||
|
||||
# Set healthcheck route |
||||
RUN apk --no-cache add curl |
||||
HEALTHCHECK CMD curl -f http://localhost/healthcheck || exit 1 |
||||
|
||||
# Copy nginx conf |
||||
COPY nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf |
||||
|
||||
# Copy application bundle |
||||
RUN mkdir -p /var/www/html |
||||
COPY --from=builder /usr/src/app/build /var/www/html/ |
||||
|
||||
# Runtime |
||||
EXPOSE 80 |
||||
CMD ["nginx", "-g", "daemon off;"] |
@ -0,0 +1,17 @@ |
||||
FROM nginx:1.15-alpine |
||||
|
||||
# Set healthcheck route |
||||
RUN apk --no-cache add curl |
||||
HEALTHCHECK CMD curl -f http://localhost/healthcheck || exit 1 |
||||
|
||||
# Copy nginx conf |
||||
COPY docker/default.conf /etc/nginx/conf.d/default.conf |
||||
COPY docker/config.json.template /tmp/config.json.template |
||||
|
||||
# Copy application bundle |
||||
RUN mkdir -p /var/www/html |
||||
COPY build /var/www/html/ |
||||
|
||||
# Runtime |
||||
EXPOSE 80 |
||||
CMD envsubst < /tmp/config.json.template > /var/www/html/config.json && nginx -g "daemon off;" |
@ -0,0 +1,5 @@ |
||||
{ |
||||
"accountIngressAddress": "${ACCOUNT_INGRESS_CONTRACT_ADDRESS}", |
||||
"nodeIngressAddress": "${NODE_INGRESS_CONTRACT_ADDRESS}", |
||||
"networkId": "${NETWORK_ID}" |
||||
} |
Loading…
Reference in new issue