-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (23 loc) · 848 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
FROM alpine:latest
ENV GO_VERSION 1.9.2-r1
ENV GOPATH /go
ENV PROJECT_DIR github.com/anhnguyen300795/Task-manager
ENV WORKDIR = ${GOPATH}/src/${PROJECT_DIR}/src
WORKDIR ${WORKDIR}
# Copy the local package files to the container's workspace.
COPY ./src .
# Update list of softwares that need updating & upgrade those softwares to latest version
RUN apk update && apk upgrade && \
# add extra package for installation
apk add git go=$GO_VERSION musl-dev && \
# remove cached info
rm -rf /var/cache/apk/*
# Recursively add excecution permission for files under scripts folder
RUN chmod -R +x ./scripts
# Generate log file text
RUN cd scripts && ./log.sh
# Install golang project's dependencies
RUN go get ${PROJECT_DIR}/...
# Document that the service listens on port 8080.
EXPOSE 8080
ENTRYPOINT [ "./scripts/start.sh" ]