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

Покоритель баз данных #5

Merged
merged 4 commits into from
Oct 13, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 15 additions & 0 deletions Workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,21 @@ npm run mock:server
npm run ts ./src/main.cli.ts -- --generate 100 ./mocks/test-data.tsv http://localhost:3123/api
```

### --import

```bash
npm run ts ./src/main.cli.ts -- --import ./src/mocks/test-data.tsv admin test localhost six-sities secret
```

```bash
./cli.js --generate 10 ./mocks/mock-offers.tsv http://localhost:3123/api
```

## Запуск docker-compose файла для запуска служб баз данных

```bash
docker compose --file ./docker-compose.dev.yml --env-file ./.env --project-name "six-cities" up -d
```



28 changes: 28 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
services:
db:
image: mongo:4.2
restart: always
container_name: six-cities_mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- ${DB_PORT}:27017
volumes:
- six-cities_data:/data/db

db_ui:
image: mongo-express:latest
restart: always
container_name: six-cities_mongo_express
ports:
- 8082:8081
environment:
ME_CONFIG_BASICAUTH_USERNAME: ${DB_USER}
ME_CONFIG_BASICAUTH_PASSWORD: ${DB_PASSWORD}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_USER}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${DB_USER}:${DB_PASSWORD}@db:${DB_PORT}/

volumes:
six-cities_data:
Loading
Loading