62 lines
1.3 KiB
Plaintext
Executable File
62 lines
1.3 KiB
Plaintext
Executable File
yamlversion: '3.8'
|
|
|
|
services:
|
|
db:
|
|
image: mysql:5.7
|
|
restart: always
|
|
environment:
|
|
MYSQL_ROOT_PASSWORD: gitea_root_password
|
|
MYSQL_DATABASE: gitea
|
|
MYSQL_USER: gitea
|
|
MYSQL_PASSWORD: gitea_password
|
|
volumes:
|
|
- db_data:/var/lib/mysql
|
|
|
|
gitea:
|
|
image: gitea/gitea:latest
|
|
restart: always
|
|
environment:
|
|
GITEA__database__DB_TYPE: mysql
|
|
GITEA__database__HOST: db:3306
|
|
GITEA__database__NAME: gitea
|
|
GITEA__database__USER: gitea
|
|
GITEA__database__PASSWD: gitea_password
|
|
GITEA__server__ROOT_URL: http://localhost:3000
|
|
GITEA__server__DOMAIN: localhost
|
|
GITEA__server__SSH_PORT: 2222
|
|
GITEA__server__HTTP_PORT: 3000
|
|
ports:
|
|
- "3000:3000"
|
|
- "2222:2222"
|
|
volumes:
|
|
- gitea_data:/data
|
|
|
|
nginx:
|
|
image: nginx:latest
|
|
restart: always
|
|
ports:
|
|
- "80:80"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/conf.d/default.conf
|
|
depends_on:
|
|
- gitea
|
|
|
|
volumes:
|
|
db_data:
|
|
gitea_data:
|
|
**************************************
|
|
nginxserver {
|
|
listen 80;
|
|
|
|
server_name localhost;
|
|
|
|
location / {
|
|
proxy_pass http://gitea:3000;
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
}
|
|
|