From 6d3d1cc5d73cc5ade55430e29f47e03d5b58d76d Mon Sep 17 00:00:00 2001 From: decryp7 Date: Tue, 11 Jul 2023 20:50:02 +0800 Subject: [PATCH] Add Dockerfile and CI --- .drone.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 14 ++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .drone.yml create mode 100644 Dockerfile diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 000000000..ef0b72eb2 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,27 @@ +kind: pipeline +type: docker +name: default + +platform: + os: linux + +steps: +- name: build + image: plugins/docker + environment: + DOCKER_USERNAME: + from_secret: repo_username + DOCKER_PASSWORD: + from_secret: repo_password + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker login docker.decryptology.net -u $DOCKER_USERNAME -p $DOCKER_PASSWORD + - docker build --no-cache -t docker.decryptology.net/decryptology/virtualtabletop:latest . + - docker push docker.decryptology.net/decryptology/virtualtabletop:latest + +volumes: + - name: dockersock + host: + path: /var/run/docker.sock \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..09c4a99ed --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:18.12.1 +ENV NODE_ENV=production + +EXPOSE 8272 +VOLUME /virtualtabletop-main/save +WORKDIR /app + +COPY ["package.json", "package-lock.json*", "./"] + +RUN npm install --production + +COPY . . + +CMD [ "node", "server.mjs" ] \ No newline at end of file