Merge pull request #169 from tanshunyuan/164/add-docker-compose

Add docker compose file for local development
This commit is contained in:
Nevo David 2024-05-04 19:39:48 +07:00 committed by GitHub
commit eb7add2587
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 34 additions and 2 deletions

View File

@ -1,5 +1,5 @@
DATABASE_URL=""
REDIS_URL=""
DATABASE_URL="postgres://<user>:<password>@<host>:<port>/<database_name>"
REDIS_URL="redis://<host>:<port>"
UPLOAD_DIRECTORY=""
NEXT_PUBLIC_UPLOAD_STATIC_DIRECTORY=""
STRIPE_PUBLISHABLE_KEY=""

View File

@ -87,6 +87,12 @@ npm run prisma-db-push
```
</Step>
<Step title="Setup postgres & redis via docker compose">
```bash Terminal
docker compose -f "docker-compose.dev.yaml" up
```
</Step>
<Step title="Run the project">
```bash Terminal
npm run dev

26
docker-compose.dev.yaml Normal file
View File

@ -0,0 +1,26 @@
version: '3.9'
services:
gitroom-postgres:
image: postgres:14.5
container_name: gitroom-postgres
restart: always
environment:
POSTGRES_PASSWORD: gitroom-local-pwd
POSTGRES_USER: gitroom-local
POSTGRES_DB: gitroom-db-local
volumes:
- postgres-volume:/var/lib/postgresql/data
ports:
- 5432:5432
gitroom-redis:
image: redis:7.2
container_name: gitroom-redis
restart: always
ports:
- 6379:6379
volumes:
postgres-volume:
external: false