[op-65] deployment docker image (#122)

pull/134/head
Chris Mckay 5 years ago committed by GitHub
parent 2dc2d9400a
commit a158710efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 34
      Dockerfile
  2. 2
      Jenkinsfile.release
  3. 17
      docker/Dockerfile
  4. 5
      docker/config.json.template
  5. 0
      docker/default.conf

@ -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;"]

@ -50,7 +50,7 @@ pipeline {
}
stage('Build') {
steps {
sh 'yarn run build'
sh 'GENERATE_SOURCEMAP=false yarn run build'
}
}
stage('Prep bundles') {

@ -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…
Cancel
Save