0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

giteaをdockerで立てる

0
Last updated at Posted at 2026-04-27

gitea を docker-compose で起こしてみました

ちなみに、postgreSQLのバージョンは18.3です

DB側の設定

DBは、postgreSQLを使います。
gitea用のDBとユーザを作ります

CREATE USER gitea_user WITH PASSWORD 'xxxxxx';
CREATE DATABASE giteadb OWNER gitea_user;
GRANT ALL PRIVILEGES ON DATABASE giteadb TO gitea_user;

docker-compose.yml

61007,8 ポートで待ち受けることにしました

vi docker-compose.yml
services:
  server:
    image: gitea/gitea
    container_name: gitea
    environment:
      - USER_UID=1000
      - USER_GID=1000
      - GITEA__database__DB_TYPE=postgres
      - GITEA__database__HOST=${GITEA_DB_POSTGRES}
      - GITEA__database__NAME=${GITEA_DB_NAME}
      - GITEA__database__USER=${GITEA_DB_USER}
      - GITEA__database__PASS=${GITEA_DB_PASSWORD}
    restart: always
    volumes:
      - ./docker/gitea:/data
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "61007:3000" # Web UI用
      - "61008:22"   # SSH用

参考

vi .env
GITEA_DB_USER=gitea_user
GITEA_DB_PASSWORD=xxxxxx
GITEA_DB_NAME=giteadb
GITEA_DB_POSTGRES=192.168.x.x:5432

完成

image.png

試しにリポジトリ作って からアクセスしてみました

コマンドから確認

testrep : オープン
testprivaterep : プライベート

% git clone http://192.168.x.x:61007/xxxxx/testrep.git

Cloning into 'testrep'...
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (9/9), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 9 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (9/9), done.

% git clone http://192.168.x.x:61007/xxxxx/testprivaterep.git
Cloning into 'testprivaterep'...
Username for 'http://192.168.x.x:61007': xxxxx
Password for 'http://xxxxx@192.168.x.x:61007':
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (3/3), done.

プライベートの方は認証になりました

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?