From b372f5a3b66b52db3da90affdece602469ace93a Mon Sep 17 00:00:00 2001 From: elhmn Date: Sat, 10 Aug 2024 16:14:27 +0200 Subject: [PATCH] build separate images --- .github/workflows/deploy-frontend.yaml | 5 ++++- frontend/Dockerfile | 3 ++- frontend/nginx-custom.conf | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-frontend.yaml b/.github/workflows/deploy-frontend.yaml index cf7b9891..61d6cc29 100644 --- a/.github/workflows/deploy-frontend.yaml +++ b/.github/workflows/deploy-frontend.yaml @@ -11,7 +11,7 @@ on: env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }}-frontend + IMAGE_NAME: ${{ github.repository }}-frontend-stage jobs: build-and-push-image: @@ -43,6 +43,9 @@ jobs: uses: docker/build-push-action@v2 with: context: ./frontend + build-args: | + baseURL=https://osscameroon-website-api.stage.osscameroon.com + env=development push: true tags: ${{ steps.meta.outputs.tags }} diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 388aef6d..a93cdc01 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,5 +1,6 @@ FROM node:12.22-buster-slim -ARG baseURL="https://osscameroon-website-api.stage.osscameroon.com" +ARG baseURL="localhost:8811" +ARG env="development" ENV REACT_APP_API_BASE_URL=$baseURL ENV REACT_APP_ENV=$env diff --git a/frontend/nginx-custom.conf b/frontend/nginx-custom.conf index f746126d..46516cd6 100644 --- a/frontend/nginx-custom.conf +++ b/frontend/nginx-custom.conf @@ -5,6 +5,7 @@ server { location / { root /static; index index.html index.htm; + try_files $uri $uri/ /index.html; } }