Spaces:
Build error
Build error
| # Use an official golang runtime as a parent image | |
| FROM golang:1.21 | |
| # Set the working directory in the container to /app | |
| WORKDIR /app | |
| # Copy go.mod and go.sum files to the workspace | |
| COPY go.mod go.sum ./ | |
| # Download all dependencies. They will be cached if the go.mod and go.sum files are not changed | |
| RUN go mod download | |
| # Copy the source code into the container | |
| COPY . . | |
| # Build the application | |
| RUN go build -o /usr/local/bin/chisel github.com/jpillora/chisel | |
| # Expose port 8080 for the chisel server | |
| EXPOSE 8080 | |
| # Command to run the executable | |
| CMD ["chisel", "server", "--port", "8080"] | |