Skip to content

Commit

Permalink
feat(module) add storage service
Browse files Browse the repository at this point in the history
  • Loading branch information
sulnong committed Oct 15, 2021
1 parent 1552fc8 commit 1ca0f94
Show file tree
Hide file tree
Showing 26 changed files with 5,966 additions and 15 deletions.
49 changes: 35 additions & 14 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# !!! This compose file only for development use
version: '3.8'
services:
services:
mongo:
image: bitnami/mongodb:5.0
environment:
environment:
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_INITIAL_PRIMARY_HOST=mongo
- MONGODB_ADVERTISED_HOSTNAME=mongo
Expand All @@ -18,14 +18,34 @@ services:
- db-data:/bitnami/mongodb
ports:
- "27017:27017"
networks:
networks:
- laf_shared_network


storage-service:
image: node:16-alpine
user: root
working_dir: /app
environment:
DB_URI : mongodb://root:password123@mongo:27017/laf-fs?authSource=admin&replicaSet=laf&writeConcern=majority
LOG_LEVEL : debug
command: npx nodemon
volumes:
- ./packages/storage-service:/app
ports:
- "9001:9001"
depends_on:
- mongo
tmpfs:
- /tmp
restart: always
networks:
- laf_shared_network

system_server:
image: node:16-alpine
user: root
working_dir: /app
environment:
environment:
SYS_DB_URI: mongodb://my_user:password123@mongo:27017/?authSource=laf-sys&replicaSet=laf&writeConcern=majority
APP_DB_URI: mongodb://root:password123@mongo:27017/?authSource=admin&replicaSet=laf&writeConcern=majority
SYS_SERVER_SECRET_SALT: Rewrite_Your_Own_Secret_Salt_abcdefg1234567
Expand All @@ -44,33 +64,34 @@ services:
user: root
ports:
- "9000"
depends_on:
depends_on:
- mongo
# tmpfs:
# tmpfs:
# - /tmp
# restart: always
networks:
networks:
- laf_shared_network

system_client:
image: nginx:latest
depends_on:
depends_on:
- mongo
- system_server
environment:
environment:
DEPLOY_DOMAIN: "*.local-dev.host" # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
SYS_CLIENT_HOST: console.local-dev.host
volumes:
- ./packages/system-client/dist:/app
- ./packages/system-client/nginx.conf:/etc/nginx/templates/default.conf.template
ports:
ports:
- 8080:80
networks:
networks:
- laf_shared_network

volumes:
db-data:

grifs-data:

networks:
laf_shared_network:
external: true
1 change: 1 addition & 0 deletions packages/app-service/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/database-proxy/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/database-ql/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/node-modules-utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions packages/storage-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
dist

upload
data/*
tmp

.env

ecosystem.config.js
.DS_Store
23 changes: 23 additions & 0 deletions packages/storage-service/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# laf-storage-service

## Notice

- dirname :
- name :

## To Do

- 文件鉴权
- 删除文件
- 删除目录

## Complete

- 创建 bucket
- 删除 bucket
- 查看 bucket 列表
- 修改 bucket
- 上传文件
- **未完成鉴权**
- 创建目录
- 按路径访问 `get` 接口
Loading

0 comments on commit 1ca0f94

Please sign in to comment.