2do/Dockerfile
Kevin Thomas 43b308dcaa
Update Docker Configuration (#26)
* Fix Docker configuration

- Fix rice embed-go failing in Dockerfile because it is expecting GOROOT
  to be /usr/local/go/src
- Modify docker-compose.yml example so that it volume mounts the db so
  that it is saved in between container restarts
- Add .dockerignore file so it doesn't copy locally created db and
  binary into the docker container

* Run go build after rice embed-go in Dockerfile
2020-07-22 22:49:54 +10:00

21 lines
336 B
Docker

FROM golang:alpine
EXPOSE 8000/tcp
ENTRYPOINT ["todo"]
RUN \
apk add --update git && \
rm -rf /var/cache/apk/*
RUN mkdir -p /usr/local/go/src/todo
WORKDIR /usr/local/go/src/todo
COPY . /usr/local/go/src/todo
RUN go get -v -d
RUN go get github.com/GeertJohan/go.rice/rice
RUN go install -v
RUN rice embed-go
RUN go build .