Skip to content
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
13 changes: 8 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
PORT=5000
PORT=3000
SALT=secret
DB_USER = test
DB_PASSWORD = test
ME_USER=test
ME_PASSWORD=test
MONGO_EXPRESS_PORT=8081
DB_USER=test
DB_PASSWORD=test
DB_HOST=127.0.0.2
DB_PORT=27017
DB_NAME=test_db
JWT_SECRET = 'secret key'
DB_NAME=db
JWT_SECRET='secret key'
UPLOAD_FILE_DIRECTORY='\src\uploads'
HOST='localhost'
STATIC_DIRECTORY_PATH = '\src\static'
25 changes: 14 additions & 11 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
version: '3.9'

# docker-compose.yaml
services:
db:
image: mongo:4.2
restart: always
container_name: six-cities-mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD:-test}
MONGO_INITDB_ROOT_USERNAME: ${DB_USER}
MONGO_INITDB_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- "${DB_PORT:-27017}:27017"
volumes:
Expand All @@ -20,17 +19,21 @@ services:
restart: always
container_name: six-cities-mongo-express
ports:
- "${MONGO_EXPRESS_PORT:-8081}:8081"
- "${MONGO_EXPRESS_PORT}:8081"
environment:
ME_CONFIG_BASICAUTH_USERNAME: ${ME_USER:-admin}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_PASSWORD:-test}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_USER:-admin}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_PASSWORD:-test}
ME_CONFIG_MONGODB_URL: mongodb://${DB_USER:-admin}:${DB_PASSWORD:-test}@db:27017/
ME_CONFIG_BASICAUTH_USERNAME: ${ME_USER}
ME_CONFIG_BASICAUTH_PASSWORD: ${ME_PASSWORD}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${DB_USER}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${DB_PASSWORD}
ME_CONFIG_MONGODB_URL: mongodb://${DB_USER}:${DB_PASSWORD}@db:27017/
depends_on:
- db
networks:
- app-network

networks:
app-network:
driver: bridge

volumes:
six-cities_data:
six-cities_data:
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
"dev:run": "node dist/main.rest.js",
"compile": "tsc -p tsconfig.json",
"clean": "rimraf dist",
"cli": "tsx ./src/cli.ts",
"cli": "node --loader ts-node/esm ./src/cli.ts",
"cli:generate": "node --loader ts-node/esm ./src/cli.ts --generate",
"cli:import": "node --loader ts-node/esm ./src/cli.ts --import",
"cli:version": "node --loader ts-node/esm ./src/cli.ts --version",
"ts": "ts-node",
"mock:server": "json-server ./src/mock/mock-server-data.json --port 3123",
"prepare": "husky"
Expand Down Expand Up @@ -68,4 +71,4 @@
"pino": "^10.3.1",
"reflect-metadata": "^0.2.2"
}
}
}
Loading
Loading