File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ .git
2+ api
Original file line number Diff line number Diff line change 1+ FROM golang
2+
3+ # if left blank app will run with dev settings
4+ # to build production image run:
5+ # $ docker build ./api --build-args app_env=production
6+ ARG app_env
7+ ENV APP_ENV $app_env
8+
9+
10+ COPY . /go/src/github.com/zucchinidev/building-distributed-system-golang/api
11+ WORKDIR /go/src/github.com/zucchinidev/building-distributed-system-golang/api
12+
13+ RUN go get ./
14+ RUN go build
15+
16+ # if dev setting will use pilu/fresh for code reloading via docker-compose volume sharing with local machine
17+ # if production setting will build binary
18+ CMD if [ ${APP_ENV} = production ]; \
19+ then \
20+ api; \
21+ else \
22+ go get github.com/pilu/fresh && \
23+ fresh; \
24+ fi
25+
26+ EXPOSE 8080
You can’t perform that action at this time.
0 commit comments