Skip to content

Commit

Permalink
update docker
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaozhou26 committed Apr 2, 2024
1 parent d321f6a commit 89d29c1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-to-api:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/chatgpt-to-api:latest
${{ secrets.DOCKERHUB_USERNAME }}/aurora:${{ github.ref_name }}
${{ secrets.DOCKERHUB_USERNAME }}/aurora:latest
21 changes: 3 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,21 @@
# Use the official Golang image as the builder
FROM golang:1.20.3-alpine as builder

# Enable CGO to use C libraries (set to 0 to disable it)
# We set it to 0 to build a fully static binary for our final image
ENV CGO_ENABLED=0

# Set the working directory
WORKDIR /app

# Copy the Go Modules manifests (go.mod and go.sum files)
COPY go.mod go.sum ./

# Download the dependencies
RUN go mod download

# Copy the source code
COPY . .
RUN go build -o /app/Aurora .

# Build the Go application and output the binary to /app/ChatGPT-Proxy-V4
RUN go build -o /app/ChatGPT-To-API .

# Use a scratch image as the final distroless image
FROM scratch

# Set the working directory
WORKDIR /app

# Copy the built Go binary from the builder stage
COPY --from=builder /app/ChatGPT-To-API /app/ChatGPT-To-API
COPY --from=builder /app/Aurora /app/Aurora

# Expose the port where the application is running
EXPOSE 8080

# Start the application
CMD [ "./ChatGPT-To-API" ]
CMD [ "./Aurora" ]

0 comments on commit 89d29c1

Please sign in to comment.