forgeplus/docker-compose.yml

77 lines
1.8 KiB
YAML
Raw Normal View History

2020-03-09 00:40:16 +08:00
version: '3'
2023-05-24 17:50:26 +08:00
networks:
gitlink:
external: false
2020-03-09 00:40:16 +08:00
services:
mysql:
image: mysql:5.7.17
command: --sql-mode=""
restart: always
volumes:
2023-05-24 17:50:26 +08:00
- ./mysql:/var/lib/mysql
2020-03-09 00:40:16 +08:00
ports:
2023-05-24 17:50:26 +08:00
- "13306:3306"
2020-03-09 00:40:16 +08:00
environment:
2023-05-24 17:50:26 +08:00
- MYSQL_ROOT_PASSWORD=gitea
- MYSQL_USER=gitea
- MYSQL_PASSWORD=gitea
- MYSQL_DATABASE=gitea
networks:
- gitlink
2020-03-09 00:40:16 +08:00
2023-05-24 17:50:26 +08:00
gitea:
image: registry.cn-hangzhou.aliyuncs.com/gitlink/gitea_hat:latest
container_name: gitea
2020-03-09 00:40:16 +08:00
restart: always
ports:
2023-05-24 17:50:26 +08:00
- "3000:3000"
2020-03-09 00:40:16 +08:00
volumes:
2023-05-24 17:50:26 +08:00
- ./gitea/app.ini:/etc/gitea/app.ini
- ./gitea/start.sh:/start.sh
- /data/repositories:/data/repositories
command:
2023-05-25 13:58:24 +08:00
- 'bash'
- '/start.sh'
2023-05-24 17:50:26 +08:00
environment:
- GITEA_WORK_DIR = /var/lib/gitea
- GITEA__database__DB_TYPE=mysql
- GITEA__database__HOST=mysql:3306
- GITEA__database__NAME=gitea
- GITEA__database__USER=gitea
- GITEA__database__PASSWD=gitea
depends_on:
- mysql
networks:
- gitlink
2020-03-09 00:40:16 +08:00
web:
2023-05-24 17:50:26 +08:00
image: gitlink-ubuntu20.04:latest
2022-09-02 11:15:35 +08:00
build:
2023-05-24 18:28:12 +08:00
context: ./
2022-09-02 11:15:35 +08:00
dockerfile: Dockerfile
2023-05-24 17:50:26 +08:00
environment:
- MYSQL_USER=root
- MYSQL_PWD=gitea
- MYSQL_HOST=mysql
- GITEA_USER=root
2023-05-25 13:58:24 +08:00
- GITEA_PWD=gitlink#2023 #GITEA_PWD from gitea/start.sh
2023-05-24 17:50:26 +08:00
- GITEA_URL=gitea
2023-05-25 11:33:29 +08:00
command:
- bash -l -c "source /etc/profile.d/rvm.sh"
- bash -c "RAILS_ENV=production rails db:create"
- bash -c "RAILS_ENV=production bundle exec rake sync_table_structure:import_csv"
- bash -c "RAILS_ENV=production rails db:migrate"
- bash -c "cmd /home/pdl/gitlink && rm -f tmp/pids/server.pid && rails s -p 4000 -b '0.0.0.0'"
2020-03-09 00:40:16 +08:00
stdin_open: true
tty: true
2023-05-24 17:50:26 +08:00
# volumes:
# - .:/home/app/gitlink
2020-03-09 00:40:16 +08:00
ports:
- "4000:4000"
depends_on:
- mysql
2023-05-24 17:50:26 +08:00
- gitea
2023-05-24 18:28:12 +08:00
networks:
- gitlink