diff --git a/.env b/.env index 822673a..3a3b4a3 100644 --- a/.env +++ b/.env @@ -1,6 +1,7 @@ NODE_LOCAL_PORT=30001 NODE_DOCKER_PORT=30001 +# TODO: docker MongoDB Replica Set MONGODB_URI=mongodb://mongodb:27017/dochub?directConnection=true MONGODB_LOCAL_PORT=27017 MONGODB_DOCKER_PORT=27017 @@ -10,3 +11,8 @@ SECRET=DO NOT USE THIS VALUE. INSTEAD, CREATE A COMPLEX SECRET AND KEEP IT SAFE GITHUB_CLIENT_ID=your github client id GITHUB_CLIENT_SECRET=your github client secret GITHUB_CALL_BACK_URL=http://127.0.0.1:3001/api/auth/github/callback + +# development local MongoDB MONGODB_URI +# MONGODB_URI=mongodb://127.0.0.1:27017/dochub?directConnection=true +# Docker development local MongoDB MONGODB_URI +# MONGODB_URI=mongodb://host.docker.internal:27017/dochub?directConnection=true \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 7c3f058..793a2ff 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -41,4 +41,9 @@ jobs: sudo docker pull zjffun/dochub-server sudo docker stop dochub-server sudo docker remove dochub-server - sudo docker run -e DOTENV_KEY="${{ secrets.DOTENV_KEY }}" -d --restart=always --name dochub-server -p 30001:30001 zjffun/dochub-server:latest + sudo docker run --name dochub-server\ + -e DOTENV_KEY="${{ secrets.DOTENV_KEY }}"\ + -p 30001:30001\ + -v /usr/share/com.zjffun.dochub:/usr/share/com.zjffun.dochub\ + -d --restart=always\ + zjffun/dochub-server:latest diff --git a/Dockerfile b/Dockerfile index 7f27721..3b5a20e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -50,4 +50,7 @@ COPY --chown=node:node .env.vault ./ COPY --chown=node:node --from=build /usr/src/app/node_modules ./node_modules COPY --chown=node:node --from=build /usr/src/app/dist ./dist +RUN apk add git +RUN git init + CMD [ "node", "dist/main.js" ] diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index a2da866..5bb99fe 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -29,6 +29,7 @@ services: - .:/usr/src/app # Prevents node_modules from being overwritten by the container - /usr/src/app/node_modules + - /usr/share/com.zjffun.dochub:/usr/share/com.zjffun.dochub volumes: db: