fix: docker script
This commit is contained in:
@@ -41,3 +41,5 @@ release.zip
|
||||
run
|
||||
|
||||
data
|
||||
assets
|
||||
.env
|
||||
|
||||
@@ -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
1
.gitignore
vendored
@@ -42,3 +42,4 @@ run
|
||||
|
||||
data
|
||||
assets
|
||||
.env
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user