diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index e1ddefaf2..ddd25c312 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,7 +1,7 @@ # These are supported funding model platforms github: joaovitoriasilva # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] -patreon: 84745218 # Replace with a single Patreon username +#patreon: # Replace with a single Patreon username #open_collective: # Replace with a single Open Collective username #ko_fi: # Replace with a single Ko-fi username #tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel diff --git a/.github/workflows/docker-image_backend_latest_manual.yml b/.github/workflows/docker-image_backend_latest_manual.yml index 5a4c93b4a..276597d4f 100644 --- a/.github/workflows/docker-image_backend_latest_manual.yml +++ b/.github/workflows/docker-image_backend_latest_manual.yml @@ -1,34 +1,3 @@ -# name: Create backend Docker image with latest tag on manual trigger - -# on: -# workflow_dispatch: - -# jobs: - -# build: - -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Build the backend Docker image -# run: | -# ls -al -# IMAGE_TAG="latest" -# docker build . --file Dockerfile_backend --tag ${{ github.repository }}/backend:$IMAGE_TAG -# echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - -# - name: Push the backend Docker image to GHCR -# if: success() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') -# run: | -# echo ${{ secrets.TOKEN_FOR_ACTIONS }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin -# IMAGE_NAME="ghcr.io/${{ github.repository }}/backend" -# docker tag ${{ github.repository }}/backend:$IMAGE_TAG $IMAGE_NAME:$IMAGE_TAG -# docker push $IMAGE_NAME:$IMAGE_TAG - name: Create backend Docker image with latest tag on manual trigger on: diff --git a/.github/workflows/docker-image_backend_manualORnewrelease.yml b/.github/workflows/docker-image_backend_manualORnewrelease.yml index bc6c6dbc7..04e7ef54a 100644 --- a/.github/workflows/docker-image_backend_manualORnewrelease.yml +++ b/.github/workflows/docker-image_backend_manualORnewrelease.yml @@ -1,41 +1,3 @@ -# name: Create backend Docker image on new release or using manual trigger - -# on: -# workflow_dispatch: -# release: -# types: -# - created - -# jobs: - -# build: - -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Build the backend Docker image -# run: | -# ls -al -# if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then -# IMAGE_TAG="dev_$(date +"%d%m%Y")" -# else -# IMAGE_TAG="${{ github.event.release.tag_name }}" -# fi -# docker build . --file Dockerfile_backend --tag ${{ github.repository }}/backend:$IMAGE_TAG -# echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - -# - name: Push the backend Docker image to GHCR -# if: success() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') -# run: | -# echo ${{ secrets.TOKEN_FOR_ACTIONS }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin -# IMAGE_NAME="ghcr.io/${{ github.repository }}/backend" -# docker tag ${{ github.repository }}/backend:$IMAGE_TAG $IMAGE_NAME:$IMAGE_TAG -# docker push $IMAGE_NAME:$IMAGE_TAG - name: Create backend Docker image on new release or using manual trigger on: @@ -66,6 +28,13 @@ jobs: run: | docker buildx create --use + - name: Verify app directory exists + run: | + if [ ! -d "./app" ]; then + echo "Directory 'app' does not exist." + exit 1 + fi + - name: Build and push the backend Docker image run: | if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then diff --git a/.github/workflows/docker-image_frontend_latest_manual.yml b/.github/workflows/docker-image_frontend_latest_manual.yml index af7743206..00e02ecf4 100644 --- a/.github/workflows/docker-image_frontend_latest_manual.yml +++ b/.github/workflows/docker-image_frontend_latest_manual.yml @@ -1,32 +1,3 @@ -# name: Create frontend Docker image with latest tag on manual trigger - -# on: -# workflow_dispatch: - -# jobs: - -# build: - -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Build the frontend Docker image -# run: | -# IMAGE_TAG="latest" -# docker build . --file Dockerfile_frontend --tag ${{ github.repository }}/frontend:$IMAGE_TAG -# echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - -# - name: Push the frontend Docker image to GHCR -# if: success() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') -# run: | -# echo ${{ secrets.TOKEN_FOR_ACTIONS }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin -# IMAGE_NAME="ghcr.io/${{ github.repository }}/frontend" -# docker tag ${{ github.repository }}/frontend:$IMAGE_TAG $IMAGE_NAME:$IMAGE_TAG -# docker push $IMAGE_NAME:$IMAGE_TAG name: Create frontend Docker image with latest tag on manual trigger on: diff --git a/.github/workflows/docker-image_frontend_manualORnewrelease.yml b/.github/workflows/docker-image_frontend_manualORnewrelease.yml index ccfc4c8a1..7cb9a1394 100644 --- a/.github/workflows/docker-image_frontend_manualORnewrelease.yml +++ b/.github/workflows/docker-image_frontend_manualORnewrelease.yml @@ -1,39 +1,3 @@ -# name: Create frontend Docker image on new release or using manual trigger - -# on: -# workflow_dispatch: -# release: -# types: -# - created - -# jobs: - -# build: - -# runs-on: ubuntu-latest - -# steps: -# - name: Checkout code -# uses: actions/checkout@v3 - -# - name: Build the frontend Docker image -# run: | -# if [ "${{ github.event_name }}" == 'workflow_dispatch' ]; then -# IMAGE_TAG="dev_$(date +"%d%m%Y")" -# else -# IMAGE_TAG="${{ github.event.release.tag_name }}" -# fi -# docker build . --file Dockerfile_frontend --tag ${{ github.repository }}/frontend:$IMAGE_TAG -# echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV -# if: github.event_name == 'release' || github.event_name == 'workflow_dispatch' - -# - name: Push the frontend Docker image to GHCR -# if: success() && (github.event_name == 'release' || github.event_name == 'workflow_dispatch') -# run: | -# echo ${{ secrets.TOKEN_FOR_ACTIONS }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin -# IMAGE_NAME="ghcr.io/${{ github.repository }}/frontend" -# docker tag ${{ github.repository }}/frontend:$IMAGE_TAG $IMAGE_NAME:$IMAGE_TAG -# docker push $IMAGE_NAME:$IMAGE_TAG name: Create frontend Docker image on new release or using manual trigger on: diff --git a/docker-compose.yml.example b/docker-compose.yml.example index 1f8548a1e..2e6546c12 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -1,12 +1,11 @@ -version: '3' services: # frontend logic frontend: container_name: frontend image: ghcr.io/joaovitoriasilva/endurain/frontend:latest #environment: - #- MY_APP_BACKEND_PROTOCOL=http # http or https, default is http - #- MY_APP_BACKEND_HOST=localhost:98 # api host or local ip (example: 192.168.1.10:98), default is localhost:98 + #- VITE_BACKEND_PROTOCOL=http # http or https, default is http + #- VITE_BACKEND_HOST=localhost:98 # api host or local ip (example: 192.168.1.10:98), default is localhost:98 # Configure volume if you want to edit the code locally by clomming the repo #volumes: # - /endurain/frontend:/app @@ -30,9 +29,9 @@ services: - FRONTEND_PORT=8080 # default is 80 ports: - "98:80" # API port, change per your needs - # Configure volume if you want to edit the code locally by clomming the repo - #volumes: - # - /endurain/backend:/app + volumes: + # - /endurain/backend:/app # Configure volume if you want to edit the code locally by cloning the repo and comment next line + - /endurain/backend/user_images:/app/user_images # necessary for user image persistence on container image updates depends_on: - mariadb - jaeger # optional diff --git a/frontend/frontend_env.sh b/frontend/frontend_env.sh index 47460b5fe..93584be8f 100644 --- a/frontend/frontend_env.sh +++ b/frontend/frontend_env.sh @@ -1,5 +1,5 @@ #!/bin/sh -for i in $(env | grep MY_APP_) +for i in $(env | grep VITE_) do key=$(echo $i | cut -d '=' -f 1) value=$(echo $i | cut -d '=' -f 2-)