-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (25 loc) · 1.02 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
# Dockerfile References: https://docs.docker.com/engine/reference/builder/
# Start from golang:1.12-alpine base image
FROM golang:1.21.6-alpine
# Install make
RUN apk add --no-cache make
# Environment variables which CompileDaemon requires to run
ENV PROJECT_DIR=/app \
GO111MODULE=on \
CGO_ENABLED=0
# Basic setup of the container
RUN mkdir /app
COPY .. /app
WORKDIR /app
# Add go path on .bashrc
RUN echo "export PATH=$PATH:$(go env GOPATH)/bin" >> ~/.bashrc
RUN echo "export PATH=$PATH:$(go env GOROOT)/bin" >> ~/.bashrc
# Get CompileDaemon
RUN go get github.com/githubnemo/CompileDaemon
RUN go install github.com/githubnemo/CompileDaemon
# Get Swag
RUN go get -u github.com/swaggo/swag/cmd/swag@latest
RUN go install github.com/swaggo/swag/cmd/swag@latest
# The build flag sets how to build after a change has been detected in the source code
# The command flag sets how to run the app after it has been built only
ENTRYPOINT CompileDaemon -build="make build" -command="make" -color=true -log-prefix=false -exclude-dir=docs