diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..1637655 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,29 @@ +name: Build Image + +on: + push: + branches: + - 'main' + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: stulzq/azure-openai-proxy:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d835b0c..fa288c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,15 @@ +FROM golang:1.19 AS building + +COPY . /building +WORKDIR /building + +RUN make build + FROM alpine:3 +WORKDIR /app + EXPOSE 8080 -COPY ./bin/azure-openai-proxy /usr/bin +COPY --from=building /building/bin . -ENTRYPOINT ["/usr/bin/azure-openai-proxy"] \ No newline at end of file +ENTRYPOINT ["/app/azure-openai-proxy"] \ No newline at end of file