Browse Source

Added docker-compose file

pull/3098/head
Andrew Hromis 9 years ago
parent
commit
4a116db32d
  1. 4
      docker/README.md
  2. 37
      docker/docker-compose.yml

4
docker/README.md

@ -18,6 +18,10 @@ $ docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs
# Use `docker start` if you have stopped it.
$ docker start gogs
# Or using docker-compose
$ POSTGRES_USER=<your_db_user> POSTGRES_PASSWORD=<your_db_password> docker-compose up -d
```
Note: It is important to map the Gogs ssh service from the container to the host and set the appropriate SSH Port and URI settings when setting up Gogs for the first time. To access and clone Gogs Git repositories with the above configuration you would use: `git clone ssh://git@hostname:10022/username/myrepo.git` for example.

37
docker/docker-compose.yml

@ -0,0 +1,37 @@
version: '2'
services:
postgres:
image: postgres:9.5
environment:
- "POSTGRES_USER=${POSTGRES_USER}"
- "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
- "POSTGRES_DB=gogs"
volumes:
- "db-data:/var/lib/postgresql/data"
networks:
- gogs
gogs:
image: gogs/gogs
ports:
- "10022:22"
- "3000:3000"
links:
- postgres
environment:
- "RUN_CROND=true"
networks:
- gogs
volumes:
- "gogs-data:/data"
depends_on:
- postgres
networks:
gogs:
driver: bridge
volumes:
db-data:
driver: local
gogs-data:
driver: local
Loading…
Cancel
Save