Dockerfile 404 B

12345678910111213
  1. FROM golang:latest as builder
  2. WORKDIR /app
  3. COPY go.mod go.sum ./
  4. RUN go mod download
  5. COPY . .
  6. RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o lightsocks-server ./cmd/lightsocks-server
  7. FROM alpine:latest
  8. LABEL maintainer="gwuhaolin <gwuhaolin@gmail.com>"
  9. ENV LIGHTSOCKS_SERVER_PORT 12315
  10. COPY --from=builder /app/lightsocks-server .
  11. EXPOSE ${LIGHTSOCKS_SERVER_PORT}
  12. CMD ./lightsocks-server