Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix YAML indentation #2455

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 36 additions & 36 deletions website/blog/2023-04-18-using-ferretdb-with-studio-3t.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,50 +34,50 @@ We can follow the [FerretDB Docker installation guide](https://docs.ferretdb.io/
1. Install Docker on your machine if you haven't already done so.
2. Create a docker-compose file with the following configurations:

```yml
services:
postgres:
image: postgres
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=ferretdb
volumes:
- ./data:/var/lib/postgresql/data
ferretdb:
image: ghcr.io/ferretdb/ferretdb
restart: on-failure
ports:
- 27017:27017
environment:
- FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/ferretdb
networks:
default:
name: ferretdb
```

The `postgres` service in the docker compose file runs a PostgreSQL database that will store its data in the "./data" directory on the host machine, which is mounted as a volume in the container.

Please update the `username` and `password` with your authentication credentials.
```yaml
services:
postgres:
image: postgres
environment:
- POSTGRES_USER=username
- POSTGRES_PASSWORD=password
- POSTGRES_DB=ferretdb
volumes:
- ./data:/var/lib/postgresql/data
ferretdb:
image: ghcr.io/ferretdb/ferretdb
restart: on-failure
ports:
- 27017:27017
environment:
- FERRETDB_POSTGRESQL_URL=postgres://postgres:5432/ferretdb
networks:
default:
name: ferretdb
```

The `postgres` service in the docker compose file runs a PostgreSQL database that will store its data in the "./data" directory on the host machine, which is mounted as a volume in the container.

Please update the `username` and `password` with your authentication credentials.

3. Run the following command to start the services:

```sh
docker compose up -d
```
```sh
docker compose up -d
```

4. For those with mongosh installed, you can run FerretDB with the following command:

```sh
mongodb://username:password@127.0.0.1/ferretdb?authMechanism=PLAIN
```
```sh
mongodb://username:password@127.0.0.1/ferretdb?authMechanism=PLAIN
```

If you don’t have mongosh installed on your system (like me), you can execute it inside a temporary MongoDB container by running the following command:
If you don’t have mongosh installed on your system (like me), you can execute it inside a temporary MongoDB container by running the following command:

```sh
docker run --rm -it --network=ferretdb --entrypoint=mongosh mongo \
"mongodb://username:password@ferretdb/ferretdb?authMechanism=PLAIN"
```
```sh
docker run --rm -it --network=ferretdb --entrypoint=mongosh mongo \
"mongodb://username:password@ferretdb/ferretdb?authMechanism=PLAIN"
```

And that’s all we need to set up FerretDB on Docker.

Expand Down