- Golang ^1.17
- swag ^1.8.2
- Mongodb
- Postgres | Mysql | Sqlite
Create .env file by .evn.example
Run flags:
-v
Verbose mode-demo
Fill database demo data-docs
Disable swagger public docs-sentry
Disable sentry-mongo
Disable mongo start initialization
At firs run use -m
flag to create database structure
Set header db-key
in each request. In socket methods set key in path.
See swagger in docs dir
version: '3.7'
services:
mongodb:
restart: always
image: mongo:4.4.0-bionic
container_name: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: dockerMongoAdmin
MONGO_INITDB_ROOT_PASSWORD: dockerMongoPassword
MONGO_INITDB_DATABASE: dockerdb
ports:
- "27017:27017"
volumes:
- .docker/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro
app:
restart: always
image: fgh151/db-server:0.0.1
depends_on:
- mongodb
container_name: db-server
ports:
- "9090:9090"
env_file:
- .env
volumes:
- .env:/.env
- ./db.db:/db.db
links:
- mongodb
watchtower:
image: containrrr/watchtower
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Create admin user
cli admin -e=admin.email.com -p=password
e
Admin emailp
Admin password
Backup databases
cli backup
s3
Upload backup to s3
Restore databases from files
cli restore -dbPath=db.tar.gz -mongoPath=mongo.targ.gz
dbPath
Path to bd backupmongoPath
Path to mongo backup
Run db migrations
cli imgrate
Fill data base demo data
cli demo