diff --git a/.travis.yml b/.travis.yml index 2e29cc9b1..71a2d457d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -48,11 +48,6 @@ deploy: on: repo: containous/traefik tags: true - - provider: script - script: sh script/deploy-docker.sh - skip_cleanup: true - on: - repo: containous/traefik - provider: pages edge: false github_token: ${GITHUB_TOKEN} diff --git a/exp.Dockerfile b/exp.Dockerfile new file mode 100644 index 000000000..189afff3f --- /dev/null +++ b/exp.Dockerfile @@ -0,0 +1,41 @@ +# WEBUI +FROM node:8.15.0 as webui + +ENV WEBUI_DIR /src/webui +RUN mkdir -p $WEBUI_DIR + +COPY ./webui/ $WEBUI_DIR/ + +WORKDIR $WEBUI_DIR +RUN yarn install + +RUN npm run build + +# BUILD +FROM golang:1.12-alpine as gobuild + +RUN apk --update upgrade \ +&& apk --no-cache --no-progress add git mercurial bash gcc musl-dev curl tar \ +&& rm -rf /var/cache/apk/* + +RUN mkdir -p /usr/local/bin \ + && curl -fsSL -o /usr/local/bin/go-bindata https://github.com/containous/go-bindata/releases/download/v1.0.0/go-bindata \ + && chmod +x /usr/local/bin/go-bindata + +WORKDIR /go/src/github.com/containous/traefik +COPY . /go/src/github.com/containous/traefik + +COPY --from=webui /src/static/ /go/src/github.com/containous/traefik/static/ + +RUN ./script/make.sh binary + +## IMAGE +FROM scratch + +COPY script/ca-certificates.crt /etc/ssl/certs/ +COPY --from=gobuild /go/src/github.com/containous/traefik/dist/traefik / + +EXPOSE 80 +VOLUME ["/tmp"] + +ENTRYPOINT ["/traefik"] diff --git a/script/deploy-docker.sh b/script/deploy-docker.sh deleted file mode 100644 index d73a95faa..000000000 --- a/script/deploy-docker.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash -set -e - -if [ -n "$TRAVIS_COMMIT" ]; then - echo "Deploying PR..." -else - echo "Skipping deploy PR" - exit 0 -fi - -# create docker image containous/traefik -echo "Updating docker containous/traefik image..." -docker login -u $DOCKER_USER -p $DOCKER_PASS -docker tag containous/traefik containous/traefik:${TRAVIS_COMMIT} -docker push containous/traefik:${TRAVIS_COMMIT} -docker tag containous/traefik containous/traefik:experimental -docker push containous/traefik:experimental - -echo "Deployed"