fix: docker script

This commit is contained in:
Innei
2021-10-02 15:10:45 +08:00
parent 9cef745dc8
commit fd7f9c870e
6 changed files with 10 additions and 5 deletions

View File

@@ -41,3 +41,5 @@ release.zip
run
data
assets
.env

View File

@@ -1,4 +1,4 @@
# THIS ENV FILE EXAMPLE ONLY FOR DOCKER COMPOSE
# SEE https://docs.docker.com/compose/environment-variables/#the-env-file
JWT_SECRET=asffasgvxczfqreqw213
ALLOWED_ORIGINS=https://innei.ren,https://www.innei.ren
ALLOWED_ORIGINS=innei.ren,www.innei.ren

1
.gitignore vendored
View File

@@ -42,3 +42,4 @@ run
data
assets
.env

View File

@@ -6,6 +6,8 @@ services:
image: innei/mx-server:latest
command: node index.js --redis_host=redis --db_host=mongo --allowed_origins=${ALLOWED_ORIGINS} --jwt_secret=${JWT_SECRET}
restart: 'on-failure'
volumes:
- ./data/mx-space:/root/.mx-space
ports:
- '2333:2333'
depends_on:
@@ -21,7 +23,7 @@ services:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
- ./data/db:/data/db
ports:
- '3344:27017'
networks:

View File

@@ -2,11 +2,11 @@ FROM node:16-alpine as builder
WORKDIR /app
COPY . .
RUN apk add git
RUN git clone https://github.com/mx-space/assets.git --depth=1
RUN rm -rf assets/.git
RUN npm i -g pnpm
RUN pnpm install
RUN pnpm bundle
RUN git clone https://github.com/mx-space/assets.git --depth=1
RUN rm -rf assets/.git
FROM node:16-alpine
RUN apk add zip unzip mongodb-tools --no-cache

View File

@@ -12,7 +12,7 @@ console.log(argv)
exports.API_VERSION = 2
exports.CROSS_DOMAIN = {
allowedOrigins: argv.allowed_origins
? argv.allowedOrigins?.split?.(',')
? argv.allowed_origins?.split?.(',') || []
: [
'innei.ren',
'shizuri.net',