Skip to content

Commit

Permalink
Merge pull request #60 from edenia/update-dockerfile-webapp
Browse files Browse the repository at this point in the history
fix(devops): update env name variables NEXT_PUBLIC
  • Loading branch information
fagomezra committed Jul 27, 2023
2 parents 885facd + aa7cf05 commit 9360414
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 81 deletions.
22 changes: 11 additions & 11 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ HAPI_HASURA_ADMIN_SECRET=myadminsecretkey

#webapp
PORT=3000
REACT_APP_TAG=$npm_package_version
REACT_APP_NAME=$npm_package_name
REACT_APP_TITLE=Boilerplate App
REACT_APP_LOGO=https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png
REACT_APP_FOOTER_LINKS=[]
REACT_APP_UAL_APP_NAME=BoilerplateWebApp
REACT_APP_UAL_API_PROTOCOL=https
REACT_APP_UAL_API_HOST=jungle.edenia.cloud
REACT_APP_UAL_API_PORT=443
REACT_APP_UAL_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
REACT_APP_HASURA_URL=http://localhost:8080/v1/graphql
NEXT_PUBLIC_TAG=$npm_package_version
NEXT_PUBLIC_NAME=$npm_package_name
NEXT_PUBLIC_TITLE=Boilerplate App
NEXT_PUBLIC_LOGO=https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png
NEXT_PUBLIC_FOOTER_LINKS=[]
NEXT_PUBLIC_UAL_APP_NAME=BoilerplateWebApp
NEXT_PUBLIC_UAL_API_PROTOCOL=https
NEXT_PUBLIC_UAL_API_HOST=jungle.edenia.cloud
NEXT_PUBLIC_UAL_API_PORT=443
NEXT_PUBLIC_UAL_CHAIN_ID=2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840
NEXT_PUBLIC_HASURA_URL=http://localhost:8080/v1/graphql
24 changes: 12 additions & 12 deletions .github/workflows/push-dev-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ jobs:
push-docker-images
env:
# webapp
PORT: 80
REACT_APP_TAG: ${{ github.ref }}
REACT_APP_NAME: 'edenia_boilerplate'
REACT_APP_TITLE: 'Fullstack Boilerplate'
REACT_APP_LOGO: 'https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png'
REACT_APP_FOOTER_LINKS: '[]'
REACT_APP_UAL_APP_NAME: 'Full-Stack Boilerplate'
REACT_APP_UAL_API_PROTOCOL: 'https'
REACT_APP_UAL_API_HOST: 'boilerplate.edenia.cloud'
REACT_APP_UAL_API_PORT: '443'
REACT_APP_UAL_CHAIN_ID: '2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840'
REACT_APP_HASURA_URL: 'https://graphql-boilerplate.edenia.cloud/v1/graphql'
PORT: 3000
NEXT_PUBLIC_TAG: ${{ github.ref }}
NEXT_PUBLIC_NAME: 'edenia_boilerplate'
NEXT_PUBLIC_TITLE: 'Fullstack Boilerplate'
NEXT_PUBLIC_LOGO: 'https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png'
NEXT_PUBLIC_FOOTER_LINKS: '[]'
NEXT_PUBLIC_UAL_APP_NAME: 'Full-Stack Boilerplate'
NEXT_PUBLIC_UAL_API_PROTOCOL: 'https'
NEXT_PUBLIC_UAL_API_HOST: 'boilerplate.edenia.cloud'
NEXT_PUBLIC_UAL_API_PORT: '443'
NEXT_PUBLIC_UAL_CHAIN_ID: '2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840'
NEXT_PUBLIC_HASURA_URL: 'https://graphql-boilerplate.edenia.cloud/v1/graphql'

- name: Build kubernetes files
id: build_kubernetes_files
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/push-prod-environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ jobs:
push-docker-images
env:
# webapp
PORT: 80
REACT_APP_TAG: ${{ github.ref }}
REACT_APP_VERSION: ${{ github.ref }}
REACT_APP_NAME: 'edenia_boilerplate'
REACT_APP_TITLE: 'Full-Stack Boilerplate'
REACT_APP_LOGO: 'https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png'
REACT_APP_FOOTER_LINKS: '[]'
REACT_APP_UAL_APP_NAME: 'Full-Stack Boilerplate'
REACT_APP_UAL_API_PROTOCOL: 'https'
REACT_APP_UAL_API_HOST: 'jungle.edenia.cloud'
REACT_APP_UAL_API_PORT: '443'
REACT_APP_UAL_CHAIN_ID: '2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840'
REACT_APP_HASURA_URL: ${{ secrets.REACT_APP_HASURA_URL }}
PORT: 3000
NEXT_PUBLIC_TAG: ${{ github.ref }}
NEXT_PUBLIC_VERSION: ${{ github.ref }}
NEXT_PUBLIC_NAME: 'edenia_boilerplate'
NEXT_PUBLIC_TITLE: 'Full-Stack Boilerplate'
NEXT_PUBLIC_LOGO: 'https://raw.githubusercontent.com/edenia/.github/master/.github/workflows/images/edenia-logo.png'
NEXT_PUBLIC_FOOTER_LINKS: '[]'
NEXT_PUBLIC_UAL_APP_NAME: 'Full-Stack Boilerplate'
NEXT_PUBLIC_UAL_API_PROTOCOL: 'https'
NEXT_PUBLIC_UAL_API_HOST: 'jungle.edenia.cloud'
NEXT_PUBLIC_UAL_API_PORT: '443'
NEXT_PUBLIC_UAL_CHAIN_ID: '2a02a0053e5a8cf73a56ba0fda11e4d92e0238a4a2aa74fccf46d5a910746840'
NEXT_PUBLIC_HASURA_URL: ${{ secrets.NEXT_PUBLIC_HASURA_URL }}

- name: Build kubernetes files
id: build_kubernetes_files
Expand Down
20 changes: 10 additions & 10 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,15 @@ services:
working_dir: /app
command: bash -c "yarn && yarn start"
environment:
REACT_APP_TAG: '${REACT_APP_TAG}'
REACT_APP_TITLE: '${REACT_APP_TITLE}'
REACT_APP_LOGO: '${REACT_APP_LOGO}'
REACT_APP_FOOTER_LINKS: '${REACT_APP_FOOTER_LINKS}'
REACT_APP_UAL_APP_NAME: '${REACT_APP_UAL_APP_NAME}'
REACT_APP_UAL_API_PROTOCOL: '${REACT_APP_UAL_API_PROTOCOL}'
REACT_APP_UAL_API_HOST: '${REACT_APP_UAL_API_HOST}'
REACT_APP_UAL_API_PORT: '${REACT_APP_UAL_API_PORT}'
REACT_APP_UAL_CHAIN_ID: '${REACT_APP_UAL_CHAIN_ID}'
REACT_APP_HASURA_URL: '${REACT_APP_HASURA_URL}'
NEXT_PUBLIC_TAG: '${NEXT_PUBLIC_TAG}'
NEXT_PUBLIC_TITLE: '${NEXT_PUBLIC_TITLE}'
NEXT_PUBLIC_LOGO: '${NEXT_PUBLIC_LOGO}'
NEXT_PUBLIC_FOOTER_LINKS: '${NEXT_PUBLIC_FOOTER_LINKS}'
NEXT_PUBLIC_UAL_APP_NAME: '${NEXT_PUBLIC_UAL_APP_NAME}'
NEXT_PUBLIC_UAL_API_PROTOCOL: '${NEXT_PUBLIC_UAL_API_PROTOCOL}'
NEXT_PUBLIC_UAL_API_HOST: '${NEXT_PUBLIC_UAL_API_HOST}'
NEXT_PUBLIC_UAL_API_PORT: '${NEXT_PUBLIC_UAL_API_PORT}'
NEXT_PUBLIC_UAL_CHAIN_ID: '${NEXT_PUBLIC_UAL_CHAIN_ID}'
NEXT_PUBLIC_HASURA_URL: '${NEXT_PUBLIC_HASURA_URL}'
volumes:
postgres_data:
2 changes: 1 addition & 1 deletion kubernetes/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
data:
# webapp
PORT: '${PORT}'
REACT_APP_TTILE: '${REACT_APP_TTILE}'
NEXT_PUBLIC_TTILE: '${NEXT_PUBLIC_TTILE}'
---
apiVersion: v1
kind: ConfigMap
Expand Down
46 changes: 23 additions & 23 deletions webapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
FROM node:16.14.0-alpine as build-stage

ARG react_app_tag
ARG react_app_name
ARG react_app_title
ARG react_app_logo
ARG react_app_footer_links
ARG react_app_ual_app_name
ARG react_app_ual_api_protocol
ARG react_app_ual_api_host
ARG react_app_ual_api_port
ARG react_app_ual_chain_id
ARG react_app_hasura_url

ENV REACT_APP_TAG $react_app_tag
ENV REACT_APP_NAME $react_app_name
ENV REACT_APP_TITLE $react_app_title
ENV REACT_APP_LOGO $react_app_logo
ENV REACT_APP_FOOTER_LINKS $react_app_footer_links
ENV REACT_APP_UAL_APP_NAME $react_app_ual_app_name
ENV REACT_APP_UAL_API_PROTOCOL $react_app_ual_api_protocol
ENV REACT_APP_UAL_API_HOST $react_app_ual_api_host
ENV REACT_APP_UAL_API_PORT $react_app_ual_api_port
ENV REACT_APP_UAL_CHAIN_ID $react_app_ual_chain_id
ENV REACT_APP_HASURA_URL $react_app_hasura_url
ARG next_public_tag
ARG next_public_name
ARG next_public_title
ARG next_public_logo
ARG next_public_footer_links
ARG next_public_ual_app_name
ARG next_public_ual_api_protocol
ARG next_public_ual_api_host
ARG next_public_ual_api_port
ARG next_public_ual_chain_id
ARG next_public_hasura_url

ENV NEXT_PUBLIC_TAG $next_public_tag
ENV NEXT_PUBLIC_NAME $next_public_name
ENV NEXT_PUBLIC_TITLE $next_public_title
ENV NEXT_PUBLIC_LOGO $next_public_logo
ENV NEXT_PUBLIC_FOOTER_LINKS $next_public_footer_links
ENV NEXT_PUBLIC_UAL_APP_NAME $next_public_ual_app_name
ENV NEXT_PUBLIC_UAL_API_PROTOCOL $next_public_ual_api_protocol
ENV NEXT_PUBLIC_UAL_API_HOST $next_public_ual_api_host
ENV NEXT_PUBLIC_UAL_API_PORT $next_public_ual_api_port
ENV NEXT_PUBLIC_UAL_CHAIN_ID $next_public_ual_chain_id
ENV NEXT_PUBLIC_HASURA_URL $next_public_hasura_url

WORKDIR /usr/src/app

Expand Down
22 changes: 11 additions & 11 deletions webapp/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ build-docker: ./Dockerfile
@docker build \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(VERSION) \
-t $(DOCKER_REGISTRY)/$(IMAGE_NAME_WEBAPP):$(LATEST_TAG) \
--build-arg react_app_version="$(REACT_APP_VERSION)" \
--build-arg react_app_name="$(REACT_APP_NAME)" \
--build-arg react_app_title="$(REACT_APP_TITLE)" \
--build-arg react_app_logo="$(REACT_APP_LOGO)" \
--build-arg react_app_footer_links="$(REACT_APP_FOOTER_LINKS)" \
--build-arg react_app_ual_app_name="$(REACT_APP_UAL_APP_NAME)" \
--build-arg react_app_ual_api_protocol="$(REACT_APP_UAL_API_PROTOCOL)" \
--build-arg react_app_ual_api_host="$(REACT_APP_UAL_API_HOST)" \
--build-arg react_app_ual_api_port="$(REACT_APP_UAL_API_PORT)" \
--build-arg react_app_ual_chain_id="$(REACT_APP_UAL_CHAIN_ID)" \
--build-arg react_app_hasura_url="$(REACT_APP_HASURA_URL)" \
--build-arg next_public_version="$(NEXT_PUBLIC_VERSION)" \
--build-arg next_public_name="$(NEXT_PUBLIC_NAME)" \
--build-arg next_public_title="$(NEXT_PUBLIC_TITLE)" \
--build-arg next_public_logo="$(NEXT_PUBLIC_LOGO)" \
--build-arg next_public_footer_links="$(NEXT_PUBLIC_FOOTER_LINKS)" \
--build-arg next_public_ual_app_name="$(NEXT_PUBLIC_UAL_APP_NAME)" \
--build-arg next_public_ual_api_protocol="$(NEXT_PUBLIC_UAL_API_PROTOCOL)" \
--build-arg next_public_ual_api_host="$(NEXT_PUBLIC_UAL_API_HOST)" \
--build-arg next_public_ual_api_port="$(NEXT_PUBLIC_UAL_API_PORT)" \
--build-arg next_public_ual_chain_id="$(NEXT_PUBLIC_UAL_CHAIN_ID)" \
--build-arg next_public_hasura_url="$(NEXT_PUBLIC_HASURA_URL)" \
.

pull-image: ##@devops Pull the latest image from registry for caching
Expand Down

0 comments on commit 9360414

Please sign in to comment.