You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test: move mongodb to different port to avoid port conflicts (#14993)
This moves the exposed mongodb docker image port from 27017 to 27018 in
order to avoid conflict with locally installed mongodb applications
running on port 27017.
Previously, you would have to make sure you don't have mongodb running
locally when using the docker image - otherwise, it would fail to
connect.
It also adds the old .env variables commented out in the .env.example
for users who do not wish to use docker. The CONTRIBUTING.md now
includes docker installation steps for macOS users.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,9 @@ Set `PAYLOAD_DATABASE` in your `.env` file to choose the database adapter:
87
87
-`supabase` - Supabase (PostgreSQL)
88
88
-`d1` - D1 (SQLite)
89
89
90
-
Then use Docker to start your database:
90
+
Then use Docker to start your database.
91
+
92
+
On MacOS, the easiest way to install Docker is to use brew. Simply run `pnpm install --cask docker`, open the docker desktop app, apply the recommended settings and you're good to go.
URL: `mongodb://localhost:27018/payload?directConnection=true&replicaSet=mongodb-atlas-local` (no auth required)
122
+
URL: `mongodb://localhost:27019/payload?directConnection=true&replicaSet=mongodb-atlas-local` (no auth required)
121
123
122
124
### SQLite
123
125
124
126
SQLite databases don't require Docker - they're stored as files in the project.
125
127
126
128
### Testing with your own database
127
129
128
-
If you wish to use your own MongoDB database for the `test` directory instead of using the docker database, all you need to do is add the following env variable to your `.env` file:
130
+
If you wish to use your own MongoDB database for the `test` directory instead of using the docker database, add the following to your `.env` file:
129
131
130
-
-`DATABASE_URL` to your database URL e.g. `mongodb://127.0.0.1/your-test-db`.
132
+
```env
133
+
MONGODB_URL=mongodb://127.0.0.1/payloadtests # Point this to your locally installed MongoDB database
134
+
POSTGRES_URL=postgres://127.0.0.1:5432/payloadtests # Point this to your locally installed PostgreSQL database
0 commit comments