github.com/RichardKnop/Go-oauth2-server@v1.0.1/Dockerfile (about) 1 # Start from a Debian image with the latest version of Go installed 2 # and a workspace (GOPATH) configured at /go. 3 FROM golang 4 5 # Contact maintainer with any issues you encounter 6 MAINTAINER Richard Knop <risoknop@gmail.com> 7 8 # Set environment variables 9 ENV PATH /go/bin:$PATH 10 11 # Create a new unprivileged user 12 RUN useradd --user-group --shell /bin/false app 13 14 # Cd into the api code directory 15 WORKDIR /go/src/github.com/RichardKnop/go-oauth2-server 16 17 # Copy the local package files to the container's workspace. 18 ADD . /go/src/github.com/RichardKnop/go-oauth2-server 19 20 # Chown the application directory to app user 21 RUN chown -R app:app /go/src/github.com/RichardKnop/go-oauth2-server/ 22 23 # Use the unprivileged user 24 USER app 25 26 # Install the api program 27 RUN go install github.com/RichardKnop/go-oauth2-server 28 29 # User docker-entrypoint.sh script as entrypoint 30 ENTRYPOINT ["./docker-entrypoint.sh"] 31 32 # Document that the service listens on port 8080. 33 EXPOSE 8080