Refactor Docker setup and add Prisma Studio service

- Introduced a new prisma-studio service in compose.yml for easier database management.
- Added a PostgreSQL database service with environment variables for user and database setup.
- Removed the outdated node service configuration from .build/dev/compose.yml.
- Simplified the node Dockerfile by removing unnecessary shell configuration.
- Created a new prisma.Dockerfile for running Prisma Studio.

These changes enhance the development environment and streamline database interactions.
This commit is contained in:
i701 2024-12-16 21:39:03 +05:00
parent e9d81c089a
commit 1d6f4faf7e
4 changed files with 27 additions and 9 deletions

View File

@ -1,7 +0,0 @@
services:
node:
build:
context: ../../
dockerfile: .build/dev/node.Dockerfile
hostname: sarlink-portal
image: git.shihaam.dev/sarlink/sarlink-portal

View File

@ -1,7 +1,5 @@
FROM node:18
SHELL ["/bin/bash", "-c"]
WORKDIR /var/www/html
CMD npm run dev

View File

@ -0,0 +1,5 @@
FROM node:18
WORKDIR /var/www/html
CMD npx prisma studio

View File

@ -8,3 +8,25 @@ services:
- ./:/var/www/html/
ports:
- 3000:3000
prisma-studio:
build:
context: .build/dev
dockerfile: prisma.Dockerfile
hostname: sarlink-portal-studio
volumes:
- ./:/var/www/html/
ports:
- 5555:5555
database:
image: postgres:14
hostname: sarlink-portal-db
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: testpass123
POSTGRES_DB: mydb
volumes:
db-data: