diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3d2da0f..bb1916c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,10 +17,18 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build Docker image + - name: Build Docker server image uses: docker/build-push-action@v4 with: context: . push: true + target: server tags: ghcr.io/${{ github.repository }}/server:latest + - name: Build Docker client image + uses: docker/build-push-action@v4 + with: + context: . + push: true + target: client + tags: ghcr.io/${{ github.repository }}/client:latest diff --git a/Dockerfile b/Dockerfile index f4550cd..9ac52c9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,12 +4,16 @@ COPY . . RUN go mod download RUN go build -o server ./server +RUN go build -o client ./client EXPOSE 3000 -FROM alpine:latest AS runner +FROM alpine:latest AS server WORKDIR /app COPY --from=builder /app/server . - -# Run the app when the container launches CMD ["./server"] + +FROM alpine:latest AS client +WORKDIR /app +COPY --from=builder /app/client . +CMD ["./client"]