Create a .env file in the project root (you can copy from .env.example):
- Everything is setup for you, check
.env.example
cp .env.example .envEdit .env and set your desired values. For example:
DATABASE_URL=postgres://<POSTGRES_USER>:<POSTGRES_PASSWORD>@localhost:5433/<POSTGRES_DB>
POSTGRES_USER=your_postgres_user
POSTGRES_PASSWORD=your_postgres_password
POSTGRES_DB=your_database
Note: Never commit your
.envfile to version control.
Run the following command to start the database service:
docker-compose up -dThis will start a PostgreSQL instance on port 5433 using the credentials from your .env file.
After the database is running, apply your Drizzle migrations:
npx drizzle-kit migrateRun test to check whether you have setup every thing correctly:
npm run testStart your development server:
npm run devTo stop the database container:
docker-compose down