Skip to content

Commit

Permalink
chore: clarify docker dir
Browse files Browse the repository at this point in the history
  • Loading branch information
solufa committed May 7, 2024
1 parent de9d5e4 commit 0a31bab
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 21 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ $ npm i --prefix server
```sh
$ cp client/.env.example client/.env
$ cp server/.env.example server/.env
$ cp docker/dev/.env.example docker/dev/.env
```

### ミドルウェアのセットアップ
Expand Down
29 changes: 15 additions & 14 deletions compose.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
services:
firebase:
build: ./docker/dev/firebase
build: ./docker/firebase
restart: always
ports:
- 9099:9099 # Auth
- 4000:4000 # Emulator Suite UI
env_file:
- ./docker/dev/.env
working_dir: /opt/workspace
command: firebase emulators:start --only=auth --project=emulator --import ./firebase-export --export-on-exit

Expand All @@ -17,13 +15,13 @@ services:
- 9000:9000 # Storage
- 9001:9001 # Console
env_file:
- ./docker/dev/.env
- ./server/.env
volumes:
- ./docker/dev/minio/data:/data
- minio:/data
entrypoint: []
command: minio server /data --console-address :9001
command: minio server /data --address :9000 --console-address :9001
healthcheck:
test: curl -I http://localhost:9000/minio/health/live
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
interval: 5s

mc:
Expand All @@ -32,27 +30,30 @@ services:
minio:
condition: service_healthy
env_file:
- ./docker/dev/.env
- ./server/.env
entrypoint: []
command: |
sh -c "
set -euxo pipefail
mc alias set myminio http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD
mc mb myminio/$$S3_BUCKET --region=$$S3_REGION || true
mc anonymous set download myminio/$$S3_BUCKET
mc mb myminio/$$TEST_S3_BUCKET --region=$$S3_REGION || true
"
postgres:
image: postgres:13
restart: always
ports:
- 5432:5432
env_file:
- ./docker/dev/.env
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: app
TZ: Asia/Tokyo
volumes:
- database:/var/lib/postgresql/data
- postgres:/var/lib/postgresql/data

volumes:
database:
minio:
driver: local
postgres:
driver: local
6 changes: 0 additions & 6 deletions docker/dev/.env.example

This file was deleted.

File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions server/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ S3_SECRET_KEY=password
S3_REGION=ap-northeast-1
DATABASE_URL=postgresql://root:root@localhost:5432/app
TEST_DATABASE_URL=postgresql://root:root@localhost:5432/test
MINIO_ROOT_USER=minio
MINIO_ROOT_PASSWORD=password

0 comments on commit 0a31bab

Please sign in to comment.