-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
26 lines (20 loc) · 776 Bytes
/
Dockerfile
File metadata and controls
26 lines (20 loc) · 776 Bytes
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
FROM golang:1.16-alpine
WORKDIR /app
# add some necessary packages
RUN apk update && \
apk add libc-dev && \
apk add gcc && \
apk add make
# prevent the re-installation of vendors at every change in the source code
COPY ./go.mod go.sum ./
RUN go mod download && go mod verify
# Install Compile Daemon for go. We'll use it to watch changes in go files
RUN go get github.com/githubnemo/CompileDaemon
# Copy and build the app
COPY . .
COPY ./entrypoint.sh /entrypoint.sh
# wait-for-it requires bash, which alpine doesn't ship with by default. Use wait-for instead
ADD https://raw.githubusercontent.com/eficode/wait-for/v2.1.0/wait-for /usr/local/bin/wait-for
RUN chmod +rx /usr/local/bin/wait-for /entrypoint.sh
EXPOSE 8080
ENTRYPOINT [ "sh", "/entrypoint.sh" ]