diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..1c72c96 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +node_modules/** +Dockerfile +*.env +.env +.git +build/ diff --git a/.drone.yml b/.drone.yml index baf1415..920e0d4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,6 +4,15 @@ type: docker name: default steps: +- name: docker + image: plugins/docker + settings: + username: + from_secret: gitea_packpub_username + password: + from_secret: gitea_packpub_password + registry: git.simponic.xyz + repo: git.simponic.xyz/simponic/mistymountains - name: deploy image: fedora:39 commands: diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..3c2feaf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:18-alpine + +COPY package*.json ./ +USER node +RUN npm install + +COPY --chown=node:node . . +RUN npm run build + +EXPOSE 3000 +CMD [ "node", "build/index.js" ] diff --git a/deploy.sh b/deploy.sh index bb2e026..ce06441 100755 --- a/deploy.sh +++ b/deploy.sh @@ -5,6 +5,6 @@ set -e echo $SSH_KEY | base64 -d >> /tmp/key chmod -R 0600 /tmp/key -ssh -i /tmp/key -o StrictHostKeyChecking=no $HOST "cd /home/lizzy/mistymountains && git pull && git reset --hard origin/master && npm run build && sudo systemctl restart mmt" +ssh -i /tmp/key -o StrictHostKeyChecking=no $HOST "sudo systemctl restart docker-compose@mmt" rm /tmp/key