Skip to content

Commit

Permalink
fix: docker script
Browse files Browse the repository at this point in the history
  • Loading branch information
Innei committed Oct 2, 2021
1 parent 9cef745 commit fd7f9c8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,5 @@ release.zip
run

data
assets
.env
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -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 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,4 @@ run

data
assets
.env
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -21,7 +23,7 @@ services:
container_name: mongo
image: mongo
volumes:
- ./data:/data/db
- ./data/db:/data/db
ports:
- '3344:27017'
networks:
Expand Down
4 changes: 2 additions & 2 deletions dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit fd7f9c8

Please sign in to comment.