Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
550459b77f |
No files matched your search
@@ -1,2 +1,3 @@
|
|||||||
/.env
|
/.env
|
||||||
|
/ansible/inventory.ini
|
||||||
/data
|
/data
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
[defaults]
|
||||||
|
nocows = True
|
||||||
|
inventory = ./inventory.ini
|
||||||
|
interpreter_python = auto_silent
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
[gitea]
|
||||||
|
192.168.1.10 ansible_user=root
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
become: true
|
||||||
|
tasks:
|
||||||
|
- name: Setup Linux user and group
|
||||||
|
import_tasks: tasks/user.yml
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Ensure a Linux group "git" exists
|
||||||
|
ansible.builtin.group:
|
||||||
|
state: present
|
||||||
|
name: git
|
||||||
|
system: no
|
||||||
|
uid: "{{ GIT_USER_GID }}"
|
||||||
|
- name: Ensure a Linux user "git" exists
|
||||||
|
ansible.builtin.user:
|
||||||
|
state: present
|
||||||
|
name: git
|
||||||
|
group: git
|
||||||
|
password: "!"
|
||||||
|
comment: "Gitea"
|
||||||
|
system: no
|
||||||
|
uid: "{{ GIT_USER_UID }}"
|
||||||
|
create_home: no
|
||||||
|
generate_ssh_key: yes
|
||||||
|
ssh_key_bits: 4096
|
||||||
|
ssh_key_comment: "Gitea Host Key"
|
||||||
+13
-5
@@ -2,17 +2,23 @@ version: "3"
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
app:
|
app:
|
||||||
image: gitea/gitea:${GITEA_VERSION}
|
container_name: ${SERVICE_NAME}_gitea
|
||||||
restart: unless-stopped
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
environment:
|
environment:
|
||||||
- USER_GID=${USER_GID}
|
- USER_GID=${USER_GID}
|
||||||
- USER_UID=${USER_UID}
|
- USER_UID=${USER_UID}
|
||||||
|
image: ${GITEA_VERSION}
|
||||||
labels:
|
labels:
|
||||||
- traefik.docker.network=traefik-proxy
|
- traefik.docker.network=traefik-proxy
|
||||||
- traefik.enable=true
|
- traefik.enable=true
|
||||||
# HTTPS
|
### Section HTTP
|
||||||
|
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http
|
||||||
|
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=8080
|
||||||
|
# redirect to HTTPS only
|
||||||
|
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https
|
||||||
|
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_HOST}`)
|
||||||
|
### Section HTTPS
|
||||||
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
|
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
|
||||||
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=3000
|
- traefik.http.services.${TRAEFIK_SERVICE}.loadbalancer.server.port=3000
|
||||||
# configure the exposed service
|
# configure the exposed service
|
||||||
@@ -23,6 +29,7 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
- traefik-proxy
|
- traefik-proxy
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
@@ -31,15 +38,16 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- ${SSH_PORT}:22
|
- ${SSH_PORT}:22
|
||||||
db:
|
db:
|
||||||
image: mariadb:${MYSQL_VERSION}
|
container_name: ${SERVICE_NAME}_mysql
|
||||||
restart: unless-stopped
|
|
||||||
environment:
|
environment:
|
||||||
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
- MYSQL_RANDOM_ROOT_PASSWORD=yes
|
||||||
- MYSQL_USER=${MYSQL_USER}
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
|
image: ${MYSQL_VERSION}
|
||||||
networks:
|
networks:
|
||||||
- internal
|
- internal
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/mysql:/var/lib/mysql
|
- ./data/mysql:/var/lib/mysql
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
GITEA_VERSION=latest
|
GITEA_VERSION=gitea/gitea:latest
|
||||||
MYSQL_DATABASE=gitea
|
MYSQL_DATABASE=gitea
|
||||||
MYSQL_PASSWORD=
|
MYSQL_PASSWORD=
|
||||||
MYSQL_USER=gitea
|
MYSQL_USER=gitea
|
||||||
MYSQL_VERSION=10.6.3
|
MYSQL_VERSION=mariadb:10.6.3
|
||||||
SERVICE_NAME=git.mydomain.com
|
SERVICE_NAME=git.mydomain.com
|
||||||
TRAEFIK_HOST=git.mydomain.com
|
TRAEFIK_HOST=git.mydomain.com
|
||||||
TRAEFIK_ROUTER=git_mydomain_com
|
TRAEFIK_ROUTER=git_mydomain_com
|
||||||
|
|||||||
Reference in new issue
Block a user