Skip to content

Instantly share code, notes, and snippets.

@ujjkumsi
Created June 11, 2018 23:44
Show Gist options
  • Save ujjkumsi/592e087b9fcb307f9751ba58519aa70f to your computer and use it in GitHub Desktop.
Save ujjkumsi/592e087b9fcb307f9751ba58519aa70f to your computer and use it in GitHub Desktop.
FROM golang
ARG app_env
ENV APP_ENV $app_env
COPY ./app /go/src/github.com/ujjkumsi/docker-go/app
COPY ./best-practices /go/src/github.com/ujjkumsi/docker-go/best-practices
COPY ./models /go/src/github.com/ujjkumsi/docker-go/models
COPY ./dao /go/src/github.com/ujjkumsi/docker-go/dao
COPY ./dao /go/src/github.com/ujjkumsi/docker-go/util
COPY ./dao /go/src/github.com/ujjkumsi/docker-go/dialogflow
WORKDIR /go/src/github.com/ujjkumsi/docker-go/app
RUN go get ./
RUN go build
CMD if [ ${APP_ENV} = production ]; \
then \
app; \
else \
go get github.com/pilu/fresh && \
fresh; \
fi
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment