From 406efbf3f543f6f5911a6c6d4da3b9f002d5023a Mon Sep 17 00:00:00 2001 From: Joshua Delsman Date: Tue, 10 Mar 2015 07:06:10 -0700 Subject: [PATCH] Adding a project-level Dockerfile & docker-compose script --- Dockerfile | 17 +++++++++++++++++ docker-compose.yml | 12 ++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..bb2ed8d30 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM google/golang:latest + +ENV TAGS="sqlite redis memcache cert" USER="git" HOME="/home/git" + +COPY . /gopath/src/github.com/gogits/gogs/ +WORKDIR /gopath/src/github.com/gogits/gogs/ + +RUN go get -v -tags="$TAGS" github.com/gogits/gogs \ + && go build -tags="$TAGS" \ + && useradd -d $HOME -m $USER \ + && chown -R $USER . + +USER $USER + +ENTRYPOINT [ "./gogs" ] + +CMD [ "web" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000..4e3308953 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +web: + build: . + links: + - mysql + ports: + - "3000:3000" + +mysql: + image: mysql + environment: + - MYSQL_ROOT_PASSWORD=gogs + - MYSQL_DATABASE=gogs