add gitea-mariadb docker-compose
parent
7dccae29f2
commit
a8896fd2f3
@ -0,0 +1,55 @@
|
||||
# Setup gitea with Postgres DB server on Docker
|
||||
|
||||
1. Start docker
|
||||
|
||||
```
|
||||
$ docker-composer up -d
|
||||
```
|
||||
|
||||
4. Stop server
|
||||
```
|
||||
$ docker-compose down
|
||||
```
|
||||
|
||||
## Setup mySQL Database. Enter 'Y' for all question
|
||||
- Goto mariadb shell
|
||||
|
||||
```shell
|
||||
$ docker exec -it gitea-db-1 bash
|
||||
```
|
||||
|
||||
- Inside the container enter the following to setup the initial database
|
||||
```
|
||||
$ mysql_secure_installation
|
||||
```
|
||||
|
||||
```
|
||||
$ mysql -u root
|
||||
```
|
||||
|
||||
|
||||
- Allow from localhost ONLY
|
||||
```
|
||||
CREATE DATABASE gitea;
|
||||
|
||||
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'localhost' IDENTIFIED BY 'ENTERPASSWORD';
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
exit
|
||||
```
|
||||
|
||||
- Allow from subnet ONLY (172.24.*.*)
|
||||
```
|
||||
CREATE DATABASE gitea;
|
||||
|
||||
GRANT ALL PRIVILEGES ON gitea.* TO 'gitea'@'172.24.%' IDENTIFIED BY 'ENTERPASSWORD';
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
|
||||
exit
|
||||
```
|
||||
|
||||
- Then, continue with gitea setup
|
||||
- [Gitea Installation](http://localhost:3000)
|
||||
- 
|
||||
@ -0,0 +1,49 @@
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
gitea:
|
||||
external: false
|
||||
|
||||
services:
|
||||
server:
|
||||
image: gitea/gitea:1.17.3
|
||||
container_name: gitea
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
# - GITEA__database__DB_TYPE=mysql
|
||||
# - GITEA__database__HOST=db:3306
|
||||
# - GITEA__database__NAME=gitea
|
||||
# - GITEA__database__USER=gitea
|
||||
# - GITEA__database__PASSWD=gitea
|
||||
restart: always
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./gitea:/data
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
depends_on:
|
||||
- db
|
||||
db:
|
||||
image: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MARIADB_ROOT_PASSWORD: gitea
|
||||
ports:
|
||||
- 3306:3306
|
||||
networks:
|
||||
- gitea
|
||||
volumes:
|
||||
- ./mysql:/var/lib/mysql
|
||||
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:8080
|
||||
networks:
|
||||
- gitea
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Loading…
Reference in New Issue