├── .gitignore ├── LICENSE ├── README.md ├── data ├── conf │ └── app.ini ├── data │ └── .gitkeep └── log │ └── .gitkeep ├── docker-compose.yml └── repo └── .gitkeep /.gitignore: -------------------------------------------------------------------------------- 1 | /data/data/* 2 | !/data/data/.gitkeep 3 | !/data/conf/app.ini 4 | /data/log/* 5 | !/data/log/.gitkeep 6 | /repo/* 7 | !/repo/.gitkeep 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | Copyright (c) 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # [Gogs](https://gogs.io/) running with Docker Compose 2 | 3 | ## Usage 4 | 5 | ### How to start 6 | --- 7 | 1. Clone this repo. 8 | 1. Set value for the `SECRET_KEY` in the `data\config\app.ini` (e.g. using [www.random.org](https://www.random.org/strings/?num=1&len=15&digits=on&upperalpha=on&loweralpha=on&unique=off&format=html&rnd=new)). 9 | 2. Run `docker-compose up -d` to start gogs. 10 | 3. To check that your gogs application is running enter url [http://localhost:3000](http://localhost:3000) (`ROOT_URL`). 11 | 4. Register a new user account. 12 | 13 | ### How to close 14 | --- 15 | 16 | 1. Run `docker-compose stop` to stop gogs container. 17 | 2. Run `docker-compose rm -f` to remove gogs container. 18 | 3. Remove all files from `data/data`, `data/log`, `repo` and `ssh` folders. 19 | 20 | ## Settings 21 | 22 | See the [Gogs configuration cheat sheet][1] for more information. 23 | 24 | [1]: https://github.com/gogs/docs/blob/master/en-US/advanced/configuration_cheat_sheet.md "Gogs cheat sheet" 25 | -------------------------------------------------------------------------------- /data/conf/app.ini: -------------------------------------------------------------------------------- 1 | APP_NAME = Gogs 2 | RUN_USER = git 3 | RUN_MODE = prod 4 | 5 | [database] 6 | DB_TYPE = sqlite3 7 | HOST = 127.0.0.1:3306 8 | NAME = gogs 9 | USER = root 10 | PASSWD = 11 | SSL_MODE = disable 12 | PATH = data/gogs.db 13 | 14 | [repository] 15 | ROOT = /data/git/gogs-repositories 16 | 17 | [server] 18 | DOMAIN = localhost 19 | HTTP_PORT = 3000 20 | ROOT_URL = http://localhost:3000 21 | DISABLE_SSH = false 22 | SSH_PORT = 22 23 | START_SSH_SERVER = false 24 | OFFLINE_MODE = false 25 | 26 | [mailer] 27 | ENABLED = false 28 | 29 | [service] 30 | REGISTER_EMAIL_CONFIRM = false 31 | ENABLE_NOTIFY_MAIL = false 32 | DISABLE_REGISTRATION = false 33 | ENABLE_CAPTCHA = true 34 | REQUIRE_SIGNIN_VIEW = false 35 | 36 | [picture] 37 | DISABLE_GRAVATAR = false 38 | ENABLE_FEDERATED_AVATAR = false 39 | 40 | [session] 41 | PROVIDER = file 42 | 43 | [log] 44 | MODE = file 45 | LEVEL = Info 46 | ROOT_PATH = /app/gogs/log 47 | 48 | [security] 49 | INSTALL_LOCK = true 50 | SECRET_KEY = BY8ropPED6kqHpM 51 | 52 | -------------------------------------------------------------------------------- /data/data/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slupekdev/gogs-docker-compose/1965ea447a059399f2fe5b9372cb1bf364002b46/data/data/.gitkeep -------------------------------------------------------------------------------- /data/log/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slupekdev/gogs-docker-compose/1965ea447a059399f2fe5b9372cb1bf364002b46/data/log/.gitkeep -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | gogs: 5 | container_name: gogs 6 | restart: always 7 | image: gogs/gogs:latest 8 | ports: 9 | - "3022:22" 10 | - "3000:3000" 11 | volumes: 12 | - "./data:/data/gogs" 13 | - "./repo:/data/git/gogs-repositories" 14 | environment: 15 | - "RUN_CROND=true" 16 | volumes: 17 | gogs-data: 18 | driver: local 19 | -------------------------------------------------------------------------------- /repo/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/slupekdev/gogs-docker-compose/1965ea447a059399f2fe5b9372cb1bf364002b46/repo/.gitkeep --------------------------------------------------------------------------------