7
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-composeでGitBucket+PostgreSQLを起動する

Last updated at Posted at 2017-11-09

docker-composeでGitBucketとPostgreSQLを起動する。

方針

  • GitBucketは公式のDockerイメージを使う。
  • PostgreSQLの起動完了を待ってから(ポート5432にアクセス可能になってから)GitBucketを起動する。

準備

$ mkdir data
$ wget https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh -P data
$ chmod +x data/wait-for-it.sh
$ vi docker-compose.yml

docker-compose.ymlは以下のとおり。

docker-compose.yml
version: '2'

services:
  gitbucket:
    image: gitbucket/gitbucket
    restart: always
    ports:
      - 8080:8080
      - 29418:29418
    volumes:
      - ./data:/gitbucket 
    depends_on:
      - db
    environment:
      - GITBUCKET_DB_URL=jdbc:postgresql://db/gitbucket
      - GITBUCKET_DB_USER=gitbucket
      - GITBUCKET_DB_PASSWORD=gitbucket
    command: ["/gitbucket/wait-for-it.sh", "db:5432", "--", "java", "-jar", "/opt/gitbucket.war"]

  db:
    image: postgres:9.5-alpine
    restart: always
    environment:
      - POSTGRES_DB=gitbucket
      - POSTGRES_USER=gitbucket
      - POSTGRES_PASSWORD=gitbucket
    volumes:
      - ./db:/var/lib/postgresql/data

起動

$ sudo docker-compose up -d

参考

7
14
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
7
14

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?