forked from RichardKnop/go-oauth2-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
33 lines (23 loc) · 951 Bytes
/
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
# Start from a Debian image with the latest version of Go installed
# and a workspace (GOPATH) configured at /go.
FROM golang
# Contact maintainer with any issues you encounter
MAINTAINER Richard Knop <risoknop@gmail.com>
# Set environment variables
ENV PATH /go/bin:$PATH
# Create a new unprivileged user
RUN useradd --user-group --shell /bin/false app
# Cd into the api code directory
WORKDIR /go/src/github.com/RichardKnop/go-oauth2-server
# Copy the local package files to the container's workspace.
ADD . /go/src/github.com/RichardKnop/go-oauth2-server
# Chown the application directory to app user
RUN chown -R app:app /go/src/github.com/RichardKnop/go-oauth2-server/
# Use the unprivileged user
USER app
# Install the api program
RUN go install github.com/RichardKnop/go-oauth2-server
# User docker-entrypoint.sh script as entrypoint
ENTRYPOINT ["./docker-entrypoint.sh"]
# Document that the service listens on port 8080.
EXPOSE 8080