Browse Source

add docker-compose v2

pull/2911/head
ArchiFleKs 9 years ago
parent
commit
f47a2654ff
  1. 43
      docker/contrib/docker-compose/README.md
  2. 25
      docker/contrib/docker-compose/docker-compose.yaml

43
docker/contrib/docker-compose/README.md

@ -0,0 +1,43 @@
# Docker Compose
[Gogs](https://github.com/gogits/gogs) : Go Git Service
Docker Compose v2 (Docker 1.10) with mysql as database
Place docker-compose.yaml in `~/docker-compose/gogs/docker-compose.yaml` for exemple:
In the `gogs` folder, bring up the stack :
```
# docker-compose up -d
Creating network "gogs_default" with the default driver
Creating volume "gogs_gogs_db_data" with local driver
Creating volume "gogs_gogs_server_data" with local driver
Creating gogs_db
Creating gogs_server
```
Check containers :
```
# docker-compose ps
Name Command State Ports
----------------------------------------------------------------------------------------------------
gogs_db /entrypoint.sh mysqld Up 3306/tcp
gogs_server docker/start.sh /bin/s6-sv ... Up 0.0.0.0:10022->22/tcp, 0.0.0.0:3000->3000/tcp
```
Access Gogs URL to finalize installation : `http://localhost:3000`
To destroy the stack (`-v` option deletes volumes) :
```
# docker-compose down -v
Stopping gogs_server ... done
Stopping gogs_db ... done
Removing gogs_server ... done
Removing gogs_db ... done
Removing network gogs_default
Removing volume gogs_gogs_db_data
Removing volume gogs_gogs_server_data
```

25
docker/contrib/docker-compose/docker-compose.yaml

@ -0,0 +1,25 @@
version: '2'
services:
gogs_server:
image: gogs/gogs
container_name: gogs_server
ports:
- "3000:3000"
- "10022:22"
links:
- gogs_db:mysql
volumes:
- gogs_server_data:/data
gogs_db:
image: mysql
container_name: gogs_db
volumes:
- gogs_db_data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=gogs
volumes:
gogs_server_data:
driver: local
gogs_db_data:
driver: local
Loading…
Cancel
Save