diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..89d566db2 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules/ +.next +.vscode +.gitignore +README.md +.dockerignore +.git \ No newline at end of file diff --git a/.env.test b/.env.test index cceda9663..272ceb792 100644 --- a/.env.test +++ b/.env.test @@ -4,3 +4,11 @@ NEXT_PUBLIC_TILE_SERVER_SUBDOMAINS=test-k8s NEXT_PUBLIC_API_NEW=http://127.0.0.1:4010/mock NEXT_PUBLIC_BASE=/web-map-beta/demo NEXT_PUBLIC_SERVER_CONFIG_DISABLED=true +NEXT_PUBLIC_BASE= +NEXT_PUBLIC_CONFIG_API= +NEXT_PUBLIC_COUNTRY_LEADER_BOARD_DISABLED=false +NEXT_PUBLIC_SERVER_CONFIG_DISABLED=true +NEXT_PUBLIC_KEYCLOAK_URL=https://test-k8s.treetracker.org/keycloak/realms/treetracker/ +NEXT_PUBLIC_KEYCLOAK_CLIENT_ID=raw-client +NEXT_PUBLIC_KEYCLOAK_REALM=treetracker +NEXT_PUBLIC_KEYCLOAK_REDIRECT_URI=https://test.treetracker.org/ diff --git a/.github/workflows/deploy-main-channel-to-dev.yaml b/.github/workflows/deploy-main-channel-to-dev.yaml index 8f4ca2125..a80c3ccfc 100644 --- a/.github/workflows/deploy-main-channel-to-dev.yaml +++ b/.github/workflows/deploy-main-channel-to-dev.yaml @@ -25,7 +25,7 @@ jobs: - name: Use Node.js 18.x uses: actions/setup-node@v3 with: - node-version: '18.x' + node-version: '20.x' - name: npm clean install run: npm ci working-directory: ${{ env.project-directory }} @@ -59,9 +59,9 @@ jobs: uses: docker/build-push-action@v2 with: context: ./ - file: ./Dockerfile + file: ./Dockerfile-dev push: true - tags: greenstand/${{ github.event.repository.name }}:${{ steps.package-version.outputs.current-version }} + tags: greenstand/${{ github.event.repository.name }}-dev:${{ steps.package-version.outputs.current-version }} - id: export_bumped_version run: | @@ -83,7 +83,7 @@ jobs: - name: Install kustomize run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash - name: Run kustomize - run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}:${{ needs.release.outputs.bumped_version }} ) + run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}-dev:${{ needs.release.outputs.bumped_version }} ) - name: Install doctl for kubernetes uses: digitalocean/action-doctl@v2 with: diff --git a/.github/workflows/deploy-main-channel-to-test.yaml b/.github/workflows/deploy-main-channel-to-test.yaml index 4908d369a..28cb37c11 100644 --- a/.github/workflows/deploy-main-channel-to-test.yaml +++ b/.github/workflows/deploy-main-channel-to-test.yaml @@ -27,7 +27,7 @@ jobs: - name: Use Node.js 18.x uses: actions/setup-node@v1 with: - node-version: '18.x' + node-version: '20.x' - name: get-npm-version id: package-version uses: martinbeentjes/npm-get-version-action@master @@ -35,10 +35,28 @@ jobs: run: | export BUMPED_VERSION="${{ steps.package-version.outputs.current-version }}" echo "bumped_version=${BUMPED_VERSION}" >> $GITHUB_OUTPUT + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 + with: + context: ./ + push: true + file: ./Dockerfile-test + tags: greenstand/${{ github.event.repository.name }}-test:${{ steps.package-version.outputs.current-version }} - name: Install kustomize run: curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash - name: Run kustomize - run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}:${{ steps.export_bumped_version.outputs.bumped_version }} ) + run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}-test:${{ steps.export_bumped_version.outputs.bumped_version }} ) - name: Install doctl for kubernetes uses: digitalocean/action-doctl@v2 with: diff --git a/.github/workflows/dev-build-release.yaml b/.github/workflows/dev-build-release.yaml index 7941d87b3..d48eea7d9 100644 --- a/.github/workflows/dev-build-release.yaml +++ b/.github/workflows/dev-build-release.yaml @@ -67,9 +67,9 @@ jobs: uses: docker/build-push-action@v2 with: context: ./ - file: ./Dockerfile + file: ./Dockerfile-dev push: true - tags: greenstand/${{ github.event.repository.name }}:${{ steps.package-version.outputs.current-version }} + tags: greenstand/${{ github.event.repository.name }}-dev:${{ steps.package-version.outputs.current-version }} - id: export_bumped_version run: | @@ -109,7 +109,7 @@ jobs: #- name: Print channel # run: echo ${{ steps.channel.outputs.CHANNEL }} - name: Run kustomize - run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}:${{needs.release.outputs.bumped_version}} ) + run: (cd deployment/base && ../../kustomize edit set image greenstand/${{ github.event.repository.name }}-dev:${{needs.release.outputs.bumped_version}} ) - name: Install doctl for kubernetes uses: digitalocean/action-doctl@v2 with: diff --git a/Dockerfile-dev b/Dockerfile-dev new file mode 100644 index 000000000..b22ab19c4 --- /dev/null +++ b/Dockerfile-dev @@ -0,0 +1,10 @@ +FROM node:16-alpine +WORKDIR /app +ENV PATH /app/node_modules/.bin:$PATH +COPY package.json ./ +COPY package-lock.json ./ +RUN npm ci --silent +COPY . ./ +COPY .env.development .env.production +RUN npm run build +CMD [ "npm", "run", "start" ] \ No newline at end of file diff --git a/Dockerfile-test b/Dockerfile-test new file mode 100644 index 000000000..efbeda5b0 --- /dev/null +++ b/Dockerfile-test @@ -0,0 +1,10 @@ +FROM node:16-alpine +WORKDIR /app +ENV PATH /app/node_modules/.bin:$PATH +COPY package.json ./ +COPY package-lock.json ./ +RUN npm ci --silent +COPY . ./ +COPY .env.test .env.production +RUN npm run build +CMD [ "npm", "run", "start" ] \ No newline at end of file