-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDockerfile
33 lines (28 loc) · 1.2 KB
/
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
#
# Build from the go source directory:
# docker build -t goroom:1.5 .
FROM golang:1.10
# We need gorilla, so go get it.
RUN curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
RUN cd $GOPATH
# Copy our go source files and build/install the
# code. If successful, the executable file,
# $GOPATH/bin/sample-room-golang, will be built.
RUN mkdir -p $GOPATH/src/sample-room-golang
# COPY . $GOPATH/src/sample-room-golang/
COPY ./*.go $GOPATH/src/sample-room-golang/
COPY ./routers/ $GOPATH/src/sample-room-golang/routers/
COPY ./plugins/ $GOPATH/src/sample-room-golang/plugins/
COPY ./Gopkg.toml $GOPATH/src/sample-room-golang/
COPY ./Gopkg.lock $GOPATH/src/sample-room-golang/
COPY ./container-startup.sh /usr/bin/container-startup.sh
RUN cd $GOPATH/src/sample-room-golang && dep ensure
RUN cd $GOPATH/src/sample-room-golang && go install
# Our room should always listen on port 3000 (-lp)
# although the mapped host callback port (-cp) may
# be different.
EXPOSE 3000
WORKDIR $GOPATH/src/sample-room-golang
# The real work of running the game is done in the startup script
# which reads environment variables to drive its choices for startup.
ENTRYPOINT ["/bin/bash", "/usr/bin/container-startup.sh"]