You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently there is a Dockerfile called prod.dockerfile that uses the environment file docker/.env.docker.prod.
If I understand correctly, the only way to change these variables is by editing the docker/.env.docker.prod directly when deploying to production. Either manually or by variable substitution in a CI/CD pipeline.
Possible solutions
By using --build-args in docker build command, the variables can can be specified instead of only using redacted as now in the docker/.env.docker.prod file.
Please let us know whether this is a new topic or a topic change request:
New Topic Request (ie. missing entire topic/section)
Topic Change Request (ie. spelling, organization)
Full working files for deployment to Google Cloud Run
Dockerfile:
FROM node:12.16.3-alpine as build
# working directoryWORKDIR /usr/src/app
# global environment setup : yarn + dependencies needed to support node-gypRUN apk --no-cache --virtual add \
python \
make \
g++ \
yarn
# set env variable for CIENV CI=true
# copy root dependency files and configs needed for installCOPY package.json yarn.lock babel.config.js magento-compatibility.js ./
COPY scripts/monorepo-introduction.js ./scripts/monorepo-introduction.js
# copy over the packagesCOPY packages ./packages
# copy configuration env file from host file system to venia-concept .env for buildCOPY ./docker/.env.docker.prod ./packages/venia-concept/.env
# specified as --build-argARG MAGENTO_BACKEND_URL
ENV MAGENTO_BACKEND_URL=$MAGENTO_BACKEND_URL
ARG MAGENTO_BACKEND_EDITION
ENV MAGENTO_BACKEND_EDITION=$MAGENTO_BACKEND_EDITION
# install dependencies with yarnRUN yarn install --frozen-lockfile
ENV NODE_ENV=production
# build the appRUN yarn run build
# MULTI-STAGE BUILDFROM node:12.16.3-alpine
# working directoryWORKDIR /usr/src/app
# node:alpine comes with a configured user and groupRUN chown -R node:node /usr/src/app
# copy build from previous stageCOPY --from=build /usr/src/app .
USER node
EXPOSE 8080
ENV NODE_ENV=production
# command to run applicationCMD [ "yarn", "stage:venia" ]
github-jira-sync-bot
changed the title
[doc]: Deployment on eg. Google Cloud Run
[doc]: Deployment on eg. Google Cloud Run - using --build-arg for dockerfiles
May 19, 2022
Describe the request
Currently there is a Dockerfile called
prod.dockerfile
that uses the environment filedocker/.env.docker.prod
.If I understand correctly, the only way to change these variables is by editing the
docker/.env.docker.prod
directly when deploying to production. Either manually or by variable substitution in a CI/CD pipeline.Possible solutions
By using
--build-arg
s indocker build
command, the variables can can be specified instead of only usingredacted
as now in thedocker/.env.docker.prod
file.Example of using
--build-arg
s in a Dockerfile:Example of using
--build-arg
s in a GitHub workflow:Please let us know whether this is a new topic or a topic change request:
Full working files for deployment to Google Cloud Run
Dockerfile:
Deployment file:
The text was updated successfully, but these errors were encountered: