-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
31 lines (28 loc) · 865 Bytes
/
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
FROM node:9 as js-build
WORKDIR /root
COPY web /root
RUN npm install
RUN npm run build
FROM golang:1.10 as go-build
RUN apt-get update \
&& apt-get install -y libgphoto2-dev \
&& rm -rf /var/lib/apt/lists/*
RUN go get github.com/kardianos/govendor
RUN mkdir -p /go/src/github.com/kochman/hotshots
WORKDIR /go/src/github.com/kochman/hotshots
COPY vendor/vendor.json ./vendor/
RUN govendor sync
COPY . /go/src/github.com/kochman/hotshots
RUN go build
FROM debian:stable as runner
RUN apt-get update \
&& apt-get install -y libgphoto2-dev \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /root
COPY --from=go-build /go/src/github.com/kochman/hotshots/hotshots .
COPY --from=js-build /root/assets ./web/assets
COPY --from=js-build /root/*.html ./web/
ENV HOTSHOTS_LISTEN_URL 0.0.0.0:8000
VOLUME /var/hotshots
EXPOSE 8000/tcp
CMD ["/root/hotshots", "server"]