diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 1739c3f..a1dca6e 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -21,7 +21,7 @@ jobs: uses: docker/build-push-action@v5.3.0 with: builder: ${{ steps.setup_buildx.name }} - context: ./fe + context: . file: Dockerfile target: fe cache-from: | @@ -33,46 +33,10 @@ jobs: tags: | sssomeshhh/rentify:fe sssomeshhh/rentify:fe-${{ github.sha }} - build-args: - XE=fe - - be: - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Login to Docker Hub - uses: docker/login-action@v3.1.0 - with: - registry: docker.io - username: sssomeshhh - password: ${{ secrets.DOCKER_HUB_TOKEN }} - - name: Setup Docker Buildx - id: setup_buildx - uses: docker/setup-buildx-action@v3.3.0 - - name: Build Target - uses: docker/build-push-action@v5.3.0 - with: - builder: ${{ steps.setup_buildx.name }} - context: ./be - file: Dockerfile - target: be - cache-from: | - type=registry,ref=sssomeshhh/cache:rentify-be - cache-to: | - type=registry,ref=sssomeshhh/cache:rentify-be - load: false - push: true - tags: | - sssomeshhh/rentify:be - sssomeshhh/rentify:be-${{ github.sha }} - build-args: - XE=be fs: runs-on: ubuntu-22.04 needs: - - be - fe steps: - name: Checkout diff --git a/Dockerfile b/Dockerfile index 246e0ec..f303cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,8 @@ -FROM node:current-bullseye-slim as base +FROM node:current-bullseye-slim as fe RUN corepack enable -ARG XE -WORKDIR /root/$XE -COPY package.json . -COPY yarn.lock . +COPY ./fe /root +WORKDIR /root/fe RUN yarn install -COPY . . - -FROM base as be -# RUN yarn produce - -FROM base as fe RUN yarn produce FROM mongo:latest as fs @@ -21,7 +13,7 @@ RUN apt-get update && \ apt-get install --yes nodejs && \ corepack enable COPY --from=sssomeshhh/rentify:fe /root/fe/build /root/fe/build -COPY --from=sssomeshhh/rentify:be /root/be /root/be +COPY ./be /root WORKDIR /root/be RUN yarn install ENV SERVER_PORT=80