diff --git a/.github/workflows/main2.yml b/.github/workflows/main2.yml index efab12d..11aa0f4 100644 --- a/.github/workflows/main2.yml +++ b/.github/workflows/main2.yml @@ -30,7 +30,6 @@ jobs: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} run: | - docker build -t backend-everyshilling_app-auth:latest -f services/app-auth/Dev.Dockerfile services/app-auth docker build -t backend-everyshilling_app-db:latest -f services/app-db/Dev.Dockerfile services/app-db docker build -t backend-everyshilling_app-otp:latest -f services/app-otp/Dockerfile services/app-otp @@ -41,24 +40,6 @@ jobs: docker push ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-db docker push ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-otp - # run: | - # make build-dev - - # APP_AUTH_TAG=$(docker images --filter=reference='everyshilling_app-auth:latest' --format "{{.ID}}") - # APP_DB_TAG=$(docker images --filter=reference='everyshilling_app-db:latest' --format "{{.ID}}") - # APP_OTP_TAG=$(docker images --filter=reference='everyshilling_app-otp:latest' --format "{{.ID}}") - - # # Tag and push the Docker images - # docker tag everyshilling_app-auth:latest ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-auth - # docker tag everyshilling_app-db:latest ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-db - # docker tag everyshilling_app-otp:latest ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-otp - # docker push ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-auth - # docker push ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-db - # docker push ${{ secrets.ECR_ACCOUNT }}/$ECR_REPOSITORY:app-otp - - - - # # everyshilling is the stack name diff --git a/.github/workflows/mockserver.yml b/.github/workflows/mockserver.yml deleted file mode 100644 index c9907b8..0000000 --- a/.github/workflows/mockserver.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: CI/CD Everyshilling - -on: - push: - branches: [ develop ] - -jobs: -#First we will see the application build or not , then we will deploy in EC2 - build: - runs-on: ubuntu-latest - - steps: - - name: Install Dependencies - run: | - sudo apt-get update - sudo apt-get install -y make - sudo apt-get -y install docker-compose - - - name: Clone repository - uses: actions/checkout@v2 - - - name: Build and Deploy microservice - run: sudo make run-dev - - diff --git a/services/app-auth/Dev.Dockerfile b/services/app-auth/Dev.Dockerfile index c21f00e..71dedb7 100644 --- a/services/app-auth/Dev.Dockerfile +++ b/services/app-auth/Dev.Dockerfile @@ -1,3 +1,40 @@ +# # Initial stage: download modules +# FROM golang:1.18-alpine as golang-builder + +# RUN apk add build-base openssl +# RUN apk --update add git ca-certificates +# RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64; + + +# FROM golang-builder AS app-builder +# WORKDIR /app/auth + +# # # Copy go mod files +# # COPY go.mod go.sum \ +# # /app/auth/ + +# COPY . /app/auth/ + +# # RUN go mod download +# # RUN go build -o /tmp/app-auth + +# # RUN go mod init + +# # Generate private and public keys +# RUN mkdir -p /etc/auth-service + +# RUN if [ ! -e "/etc/auth-service/public.pem" ]; then \ +# openssl genrsa -out /etc/auth-service/private.pem 2048; \ +# openssl rsa -in /etc/auth-service/private.pem -pubout -out /etc/auth-service/public.pem; \ +# fi; + +# FROM app-builder AS prepare-bin + +# COPY --from=app-builder /tmp/app-auth /usr/bin/auth-service + +# ENTRYPOINT ["/usr/bin/auth-service"] + + # Initial stage: download modules FROM golang:1.18-alpine as golang-builder @@ -5,19 +42,15 @@ RUN apk add build-base openssl RUN apk --update add git ca-certificates RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64; - -FROM golang-builder AS app-builder +ENV GO111MODULE=on WORKDIR /app/auth # Copy go mod files -COPY go.mod go.sum \ - /app/auth/ +COPY go.mod go.sum ./ RUN go mod download -COPY . /app/auth - - +COPY . ./ RUN go build -o /tmp/app-auth @@ -33,4 +66,4 @@ FROM app-builder AS prepare-bin COPY --from=app-builder /tmp/app-auth /usr/bin/auth-service -ENTRYPOINT ["/usr/bin/auth-service"] \ No newline at end of file +ENTRYPOINT ["/usr/bin/auth-service"]