Skip to content

Commit fd7f9c8

Browse files
committed
fix: docker script
1 parent 9cef745 commit fd7f9c8

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,5 @@ release.zip
4141
run
4242

4343
data
44+
assets
45+
.env

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# THIS ENV FILE EXAMPLE ONLY FOR DOCKER COMPOSE
22
# SEE https://docs.docker.com/compose/environment-variables/#the-env-file
33
JWT_SECRET=asffasgvxczfqreqw213
4-
ALLOWED_ORIGINS=https://innei.ren,https://www.innei.ren
4+
ALLOWED_ORIGINS=innei.ren,www.innei.ren

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ run
4242

4343
data
4444
assets
45+
.env

docker-compose.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
image: innei/mx-server:latest
77
command: node index.js --redis_host=redis --db_host=mongo --allowed_origins=${ALLOWED_ORIGINS} --jwt_secret=${JWT_SECRET}
88
restart: 'on-failure'
9+
volumes:
10+
- ./data/mx-space:/root/.mx-space
911
ports:
1012
- '2333:2333'
1113
depends_on:
@@ -21,7 +23,7 @@ services:
2123
container_name: mongo
2224
image: mongo
2325
volumes:
24-
- ./data:/data/db
26+
- ./data/db:/data/db
2527
ports:
2628
- '3344:27017'
2729
networks:

dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ FROM node:16-alpine as builder
22
WORKDIR /app
33
COPY . .
44
RUN apk add git
5+
RUN git clone https://github.com/mx-space/assets.git --depth=1
6+
RUN rm -rf assets/.git
57
RUN npm i -g pnpm
68
RUN pnpm install
79
RUN pnpm bundle
8-
RUN git clone https://github.com/mx-space/assets.git --depth=1
9-
RUN rm -rf assets/.git
1010

1111
FROM node:16-alpine
1212
RUN apk add zip unzip mongodb-tools --no-cache

src/app.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ console.log(argv)
1212
exports.API_VERSION = 2
1313
exports.CROSS_DOMAIN = {
1414
allowedOrigins: argv.allowed_origins
15-
? argv.allowedOrigins?.split?.(',')
15+
? argv.allowed_origins?.split?.(',') || []
1616
: [
1717
'innei.ren',
1818
'shizuri.net',

0 commit comments

Comments
 (0)