From 1d28e9f265fb4c857d183e9ffdf7c3b8015c6c0c Mon Sep 17 00:00:00 2001 From: Elar Saks Date: Mon, 31 Jul 2023 00:57:41 +0300 Subject: [PATCH] Remove all the fixes. --- .github/workflows/deploy-back-end.yml | 11 ++--------- cmd/blockchain_server/Dockerfile | 12 +++--------- cmd/wallet_server/Dockerfile | 14 +++++--------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/workflows/deploy-back-end.yml b/.github/workflows/deploy-back-end.yml index ca7e57c..7cb9bf1 100644 --- a/.github/workflows/deploy-back-end.yml +++ b/.github/workflows/deploy-back-end.yml @@ -4,7 +4,6 @@ on: push: branches: - DEPLOY-back-end - jobs: deploy: runs-on: ubuntu-latest @@ -30,13 +29,7 @@ jobs: username: ${{ secrets.ACR_USERNAME }} password: ${{ secrets.ACR_PASSWORD }} - - name: Get the version - id: get_version - run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)" - - name: Build and Push Docker images run: | - docker build -t goblockchain.azurecr.io/wallet-server:${{ steps.get_version.outputs.VERSION }} -f ./cmd/wallet_server/Dockerfile ../.. - docker push goblockchain.azurecr.io/wallet-server:${{ steps.get_version.outputs.VERSION }} - docker build -t goblockchain.azurecr.io/miner:${{ steps.get_version.outputs.VERSION }} -f ./cmd/blockchain_server/Dockerfile ../.. - docker push goblockchain.azurecr.io/miner:${{ steps.get_version.outputs.VERSION }} + docker-compose build --no-cache wallet-server miner-1 + docker-compose push wallet-server miner-1 diff --git a/cmd/blockchain_server/Dockerfile b/cmd/blockchain_server/Dockerfile index 1a20123..69a6b06 100644 --- a/cmd/blockchain_server/Dockerfile +++ b/cmd/blockchain_server/Dockerfile @@ -1,17 +1,10 @@ -# Start from the golang base image FROM golang:1.18.0-alpine # Set the working directory inside the container WORKDIR /app -# Copy go.mod and go.sum files -COPY go.mod go.sum ./ - -# Download all dependencies -RUN go mod download - -# Copy the entire project -COPY . . +# Copy the entire parent_folder into the container +COPY ../../ . # Install the "air" tool for live-reloading (if needed) RUN go install github.com/cosmtrek/air@latest @@ -24,3 +17,4 @@ EXPOSE ${BLOCKCHAIN_SERVER_PORT} # Set the default command to run the application CMD ["sh", "-c", "${COMMAND}"] + diff --git a/cmd/wallet_server/Dockerfile b/cmd/wallet_server/Dockerfile index f9513ea..941b8af 100644 --- a/cmd/wallet_server/Dockerfile +++ b/cmd/wallet_server/Dockerfile @@ -1,17 +1,10 @@ -# Start from the golang base image FROM golang:1.18.0-alpine # Set the working directory inside the container WORKDIR /app -# Copy go.mod and go.sum files -COPY go.mod go.sum ./ - -# Download all dependencies -RUN go mod download - -# Copy the entire project -COPY . . +# Copy the entire grand parent folder into the container +COPY ../.. . # Install the "air" tool for live-reloading (if needed) RUN go install github.com/cosmtrek/air@latest @@ -22,5 +15,8 @@ WORKDIR /app/cmd/wallet_server # Set the port number to expose for HTTP (port 8080) EXPOSE ${PORT} +# Set the port number to expose for HTTPS (port 443) +# EXPOSE 443 Azure App Service automatically handles the redirection of HTTPS traffic from port 443 to port 8080 + # Set the default command to run the application CMD ["sh", "-c", "${COMMAND}"]