Add Dockerfile and CI
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Kok Yong 2023-07-11 20:50:02 +08:00
parent 5794fbe5b5
commit 6d3d1cc5d7
2 changed files with 41 additions and 0 deletions

27
.drone.yml Normal file
View File

@ -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

14
Dockerfile Normal file
View File

@ -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" ]