forked from convox/rack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (34 loc) · 1.56 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM golang:1.11 AS development
RUN curl -Ls https://github.com/krallin/tini/releases/download/v0.18.0/tini -o /tini && chmod +x /tini
ENTRYPOINT ["/tini", "--"]
RUN curl -s https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz | \
tar -C /usr/bin --strip-components 1 -xz
RUN curl -Ls https://github.com/mattgreen/watchexec/releases/download/1.8.6/watchexec-1.8.6-x86_64-unknown-linux-gnu.tar.gz | \
tar -C /usr/bin --strip-components 1 -xz
ENV DEVELOPMENT=true
WORKDIR /go/src/github.com/convox/rack
COPY . .
RUN env CGO_ENABLED=0 go install --ldflags '-extldflags "-static"' ./cmd/convox-env
RUN go install ./cmd/build
RUN go install ./cmd/monitor
RUN go install .
CMD ["bin/web"]
FROM debian:stretch
RUN apt-get -qq update && apt-get -qq -y install curl
RUN curl -Ls https://github.com/krallin/tini/releases/download/v0.18.0/tini -o /tini && chmod +x /tini
ENTRYPOINT ["/tini", "--"]
RUN curl -s https://download.docker.com/linux/static/stable/x86_64/docker-18.03.1-ce.tgz | \
tar -C /usr/bin --strip-components 1 -xz
ENV DEVELOPMENT=false
ENV GOPATH=/go
ENV PATH=$PATH:/go/bin
WORKDIR /app
# binaries
COPY --from=development /go/bin/build /go/bin/
COPY --from=development /go/bin/convox-env /go/bin/
COPY --from=development /go/bin/monitor /go/bin/
COPY --from=development /go/bin/rack /go/bin/
# aws templates
COPY --from=development /go/src/github.com/convox/rack/provider/aws/formation/ provider/aws/formation/
COPY --from=development /go/src/github.com/convox/rack/provider/aws/templates/ provider/aws/templates/
CMD ["/go/bin/rack"]