Skip to content

Commit 6225641

Browse files
committed
feat(oss): add minio api in system-service;
1 parent ecbf75f commit 6225641

13 files changed

+8396
-2951
lines changed

docker-compose.yml

+43-8
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,16 @@ services:
3535
APP_SERVICE_IMAGE: lafyun/app-service:latest
3636
APP_SERVICE_DEPLOY_HOST: local-dev.host:8080 # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
3737
APP_SERVICE_DEPLOY_URL_SCHEMA: 'http'
38+
APP_SERVICE_ENV_NPM_INSTALL_FLAGS: '--registry=https://registry.npm.taobao.org --no-audit --no-fund'
3839
STORAGE_SERVICE_API_ENTRYPOINT: http://storage-service:9010
3940
STORAGE_SERVICE_SECRET: Rewrite_Your_Own_Secret_Salt_abcdefg1234567
4041
STORAGE_SERVICE_DEPLOY_HOST: fs.local-dev.host:8080 # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
42+
MINIO_KEY: minio-root-user
43+
MINIO_SECRET: minio-root-password
44+
MINIO_INTERNAL_ENDPOINT: http://oss:9000
45+
MINIO_EXTERNAL_ENDPOINT: http://oss.local-dev.host:8080
4146
DEBUG_BIND_HOST_APP_PATH: '${PWD}/packages/app-service'
4247
INIT_ROOT_ACCOUNT_PASSWORD: abc123
43-
APP_SERVICE_ENV_NPM_INSTALL_FLAGS: '--registry=https://registry.npm.taobao.org --no-audit --no-fund'
4448
command: sh /app/start.sh
4549
volumes:
4650
- /var/run/docker.sock:/var/run/docker.sock:ro
@@ -62,8 +66,8 @@ services:
6266
- mongo
6367
- system-server
6468
environment:
65-
DEPLOY_DOMAIN: "*.local-dev.host" # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
66-
DEPLOY_FS_DOMAIN: "*.fs.local-dev.host"
69+
DEPLOY_DOMAIN: "*.local-dev.host" # `*.local-dev.host` always resolved to 127.0.0.1, used to local development
70+
DEPLOY_FS_DOMAIN: "*.fs.local-dev.host"
6771
SYS_CLIENT_HOST: console.local-dev.host
6872
DOCS_HOST: docs.local-dev.host
6973
volumes:
@@ -80,17 +84,46 @@ services:
8084
networks:
8185
- laf_shared_network
8286

87+
oss:
88+
image: 'bitnami/minio:2022.4.9'
89+
environment:
90+
- MINIO_ROOT_USER=minio-root-user
91+
- MINIO_ROOT_PASSWORD=minio-root-password
92+
- MINIO_DISTRIBUTED_MODE_ENABLED=yes
93+
- MINIO_DISTRIBUTED_NODES=oss/data/{0...3}
94+
- MINIO_ETCD_ENDPOINTS=http://etcd:2379
95+
- MINIO_SKIP_CLIENT=yes
96+
ports:
97+
- "9020:9000"
98+
- "9120:9001"
99+
volumes:
100+
- oss-data:/data
101+
networks:
102+
- laf_shared_network
103+
104+
etcd:
105+
image: 'bitnami/etcd:latest'
106+
environment:
107+
- ALLOW_NONE_AUTHENTICATION=yes
108+
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
109+
volumes:
110+
- etcd-data:/bitnami/etcd/data
111+
ports:
112+
- 12379:2379
113+
- 12380:2380
114+
networks:
115+
- laf_shared_network
116+
117+
# deprecated: just used for old versions
83118
storage-service:
84-
image: node:16-alpine
119+
image: lafyun/storage-service:latest
85120
user: root
86121
working_dir: /app
87122
environment:
88123
DB_URI: mongodb://root:password123@mongo:27017/laf-fs?authSource=admin&replicaSet=laf&writeConcern=majority
89124
LOG_LEVEL: debug
90125
SERVER_SECRET_SALT: Rewrite_Your_Own_Secret_Salt_abcdefg1234567
91-
command: npx nodemon
92-
volumes:
93-
- ./packages/storage-service:/app
126+
94127
ports:
95128
- "9010"
96129
depends_on:
@@ -103,7 +136,9 @@ services:
103136

104137
volumes:
105138
db-data:
106-
139+
oss-data:
140+
etcd-data:
141+
107142
networks:
108143
laf_shared_network:
109144
external: true

packages/system-server/Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
55
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
66
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
77

8+
ENV MINIO_CLIENT_PATH /usr/local/bin/mc
9+
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc -O $MINIO_CLIENT_PATH && chmod +x $MINIO_CLIENT_PATH
10+
811
EXPOSE 9000
912
WORKDIR /app
1013
ENV LOG_LEVEL=debug

0 commit comments

Comments
 (0)