diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1d11df2 --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +#DATABASE_URL= diff --git a/README.md b/README.md index 984a0bf..eb1d06a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ - Docker Compose - systemd - systemd-journald +- PostgreSQL Git リポジトリを取得し、設定ファイルを配置 @@ -14,7 +15,8 @@ git clone git@github.com:kou029w/keiu.net.git cd keiu.net sudo install -m 644 {,/}etc/docker/daemon.json sudo systemctl restart docker -install -m 600 <(echo POSTGRES_PASSWORD=$(python3 -c 'import secrets; print(secrets.token_urlsafe())')) .env +cp .env{.example,} +editor .env # PostgreSQL接続URLを設定 ``` ## 構築 diff --git a/compose.yml b/compose.yml index 5160ed9..c0c4d5a 100644 --- a/compose.yml +++ b/compose.yml @@ -17,24 +17,10 @@ services: restart: unless-stopped environment: LISTEN_ADDR: /tmp/miniflux.sock - DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@/postgres?host=/tmp/postgresql + DATABASE_URL: ${DATABASE_URL} RUN_MIGRATIONS: "1" volumes: - minicharge_tmp:/tmp - - postgres_tmp:/tmp/postgresql - depends_on: - db: - condition: service_healthy - db: - image: postgres:14.3-alpine@sha256:5973fec8d8284c8961ac3c23945e52d533dd0d21cc7b3c7dd7a46fd199bed4a4 - restart: unless-stopped - healthcheck: - test: pg_isready -U postgres - environment: - POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} - volumes: - - postgres_tmp:/var/run/postgresql - - postgres_data_v14:/var/lib/postgresql/data dns.keiu.net: image: coredns/coredns:1.9.3@sha256:8e352a029d304ca7431c6507b56800636c321cb52289686a581ab70aaa8a2e2a restart: unless-stopped @@ -52,5 +38,3 @@ volumes: caddy_data: caddy_config: minicharge_tmp: - postgres_tmp: - postgres_data_v14: