2019-03-19 10:50:03 +00:00
|
|
|
# WEBUI
|
2019-10-14 15:18:04 +00:00
|
|
|
FROM node:12.11 as webui
|
2019-03-19 10:50:03 +00:00
|
|
|
|
|
|
|
ENV WEBUI_DIR /src/webui
|
|
|
|
RUN mkdir -p $WEBUI_DIR
|
|
|
|
|
|
|
|
COPY ./webui/ $WEBUI_DIR/
|
|
|
|
|
|
|
|
WORKDIR $WEBUI_DIR
|
|
|
|
|
2022-03-03 17:08:07 +00:00
|
|
|
RUN yarn install
|
|
|
|
RUN yarn build
|
2019-03-19 10:50:03 +00:00
|
|
|
|
|
|
|
# BUILD
|
2023-08-16 15:50:06 +00:00
|
|
|
FROM golang:1.21-alpine as gobuild
|
2019-03-19 10:50:03 +00:00
|
|
|
|
2022-03-03 14:42:08 +00:00
|
|
|
RUN apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar ca-certificates tzdata \
|
2019-04-01 14:48:08 +00:00
|
|
|
&& update-ca-certificates \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2019-03-19 10:50:03 +00:00
|
|
|
|
2020-09-16 13:46:04 +00:00
|
|
|
WORKDIR /go/src/github.com/traefik/traefik
|
2019-08-11 10:20:53 +00:00
|
|
|
|
|
|
|
# Download go modules
|
|
|
|
COPY go.mod .
|
|
|
|
COPY go.sum .
|
|
|
|
RUN GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
|
|
|
|
|
2020-09-16 13:46:04 +00:00
|
|
|
COPY . /go/src/github.com/traefik/traefik
|
2019-03-19 10:50:03 +00:00
|
|
|
|
2021-09-15 10:10:06 +00:00
|
|
|
RUN rm -rf /go/src/github.com/traefik/traefik/webui/static/
|
|
|
|
COPY --from=webui /src/webui/static/ /go/src/github.com/traefik/traefik/webui/static/
|
2019-03-19 10:50:03 +00:00
|
|
|
|
2019-03-19 11:24:04 +00:00
|
|
|
RUN ./script/make.sh generate binary
|
2019-03-19 10:50:03 +00:00
|
|
|
|
|
|
|
## IMAGE
|
2021-08-30 09:38:12 +00:00
|
|
|
FROM alpine:3.14
|
2019-11-12 09:44:05 +00:00
|
|
|
|
|
|
|
RUN apk --no-cache --no-progress add bash curl ca-certificates tzdata \
|
|
|
|
&& update-ca-certificates \
|
|
|
|
&& rm -rf /var/cache/apk/*
|
2019-03-19 10:50:03 +00:00
|
|
|
|
2020-09-16 13:46:04 +00:00
|
|
|
COPY --from=gobuild /go/src/github.com/traefik/traefik/dist/traefik /
|
2019-03-19 10:50:03 +00:00
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
VOLUME ["/tmp"]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/traefik"]
|