mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-22 16:58:54 +02:00
tcp/udp fix
This commit is contained in:
26
Dockerfile
26
Dockerfile
@@ -1,20 +1,30 @@
|
||||
FROM golang:1.22.1 as builder
|
||||
FROM alpine:latest AS codemirror
|
||||
RUN apk add --no-cache unzip wget make
|
||||
COPY Makefile .
|
||||
RUN make setup-codemirror
|
||||
|
||||
COPY go.mod /app/go.mod
|
||||
COPY src/ /app/src
|
||||
COPY Makefile /app
|
||||
WORKDIR /app
|
||||
RUN make get
|
||||
RUN make build
|
||||
FROM golang:1.22.1-alpine as builder
|
||||
COPY src/ /src
|
||||
COPY go.mod go.sum /src/go-proxy
|
||||
WORKDIR /src/go-proxy
|
||||
RUN --mount=type=cache,target="/go/pkg/mod" \
|
||||
go mod download
|
||||
|
||||
ENV GOCACHE=/root/.cache/go-build
|
||||
RUN --mount=type=cache,target="/go/pkg/mod" \
|
||||
--mount=type=cache,target="/root/.cache/go-build" \
|
||||
CGO_ENABLED=0 GOOS=linux go build -pgo=auto -o go-proxy
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
LABEL maintainer="yusing@6uo.me"
|
||||
|
||||
RUN apk add --no-cache tzdata
|
||||
COPY --from=builder /app/bin/go-proxy /app/
|
||||
RUN mkdir -p /app/templates
|
||||
COPY --from=codemirror templates/codemirror/ /app/templates/codemirror
|
||||
COPY templates/ /app/templates
|
||||
COPY schema/ /app/schema
|
||||
COPY --from=builder /src/go-proxy /app/
|
||||
|
||||
RUN chmod +x /app/go-proxy
|
||||
ENV DOCKER_HOST unix:///var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user