-
-
Save chinaphp/d7841a53e95ccfcb3a3e031dfb8112d1 to your computer and use it in GitHub Desktop.
Docker Compose for nginx and gitea
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| GITEA_DATA_DIR=/tmp/gitea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .env | |
| data/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| APP_NAME = Gitea | |
| RUN_MODE = prod | |
| RUN_USER = git | |
| [repository] | |
| ROOT = /data/git/repositories | |
| [repository.local] | |
| LOCAL_COPY_PATH = /data/gitea/tmp/local-repo | |
| [repository.upload] | |
| TEMP_PATH = /data/gitea/uploads | |
| [server] | |
| APP_DATA_PATH = /data/gitea | |
| DOMAIN = 0.0.0.0 | |
| SSH_DOMAIN = 0.0.0.0 | |
| HTTP_PORT = 3000 | |
| ROOT_URL = http://0.0.0.0/gitea/ | |
| DISABLE_SSH = false | |
| START_SSH_SERVER = true | |
| SSH_PORT = 2222 | |
| SSH_LISTEN_PORT = 2222 | |
| OFFLINE_MODE = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: "3.7" | |
| services: | |
| nginx: | |
| image: nginx:alpine | |
| container_name: nginx | |
| volumes: | |
| - ./nginx.conf:/etc/nginx/nginx.conf:ro | |
| - /wk171/pham/doc:/doc | |
| ports: | |
| - 80:80 | |
| gitea: | |
| image: gitea/gitea:1.16.5 | |
| container_name: gitea | |
| user: 0:${GID} | |
| env_file: .env | |
| volumes: | |
| - ${GITEA_DATA_DIR}:/data | |
| ports: | |
| - 2222:2222 | |
| networks: | |
| default: | |
| name: gitea |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .ONESHELL: | |
| all: | |
| GID=`getent group gitea | cut -d: -f3` \ | |
| docker-compose up -d | |
| down: | |
| GID=`getent group gitea | cut -d: -f3` \ | |
| docker-compose down |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| worker_processes 1; | |
| events { worker_connections 1024; } | |
| http { | |
| sendfile on; | |
| upstream gitea { | |
| server gitea:3000; | |
| } | |
| server { | |
| listen 80; | |
| server_name localhost station.topo.tw; | |
| charset utf-8; | |
| client_max_body_size 200m; | |
| location /gitea/ { | |
| proxy_pass http://gitea/; | |
| proxy_redirect off; | |
| proxy_set_header Host $host:$server_port; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_set_header X-Forwarded-Proto $scheme; | |
| } | |
| location /doc/docker/ { | |
| alias /doc/docker/; | |
| } | |
| location /doc/git { | |
| alias /doc/git/; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment