-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathDockerfile
52 lines (34 loc) · 824 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
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-alpine as builder
MAINTAINER Chakib <[email protected]>
# Copy source
COPY . /go/src/hugobot
# install dependencies and build
RUN apk add --no-cache --upgrade \
ca-certificates \
git \
openssh \
make \
alpine-sdk
RUN cd /go/src/hugobot \
&& make install
################################
#### FINAL IMAGE
###############################
FROM alpine as final
ENV WEBSITE_PATH=/website
ENV HUGOBOT_DB_PATH=/db
RUN apk add --no-cache --upgrade \
ca-certificates \
bash \
sqlite \
jq
COPY --from=builder /go/bin/hugobot /bin/
RUN mkdir -p ${HUGOBOT_DB_PATH}
RUN mkdir -p ${WEBSITE_PATH}
VOLUME ${HUGOBOT_DB_PATH}
# Expose API ports
EXPOSE 8734
# copy entrypoint
COPY "docker-entrypoint.sh" /entry
ENTRYPOINT ["/entry"]
CMD ["hugobot", "server"]