summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-05-01 00:46:57 -0700
committerElizabeth Hunt <elizabeth.hunt@simponic.xyz>2024-05-01 00:46:57 -0700
commit49eb223d9abc067a80a18b98629ab0f7d1b37176 (patch)
treec99199fd0f599a20a9e299fb55f8aaba85c88484
parentbd9fcb53a59b6ad4de0ebb83c0329f312d647b11 (diff)
downloadmistymountainstherapy-49eb223d9abc067a80a18b98629ab0f7d1b37176.tar.gz
mistymountainstherapy-49eb223d9abc067a80a18b98629ab0f7d1b37176.zip
ci/cd
-rw-r--r--.dockerignore6
-rw-r--r--.drone.yml9
-rw-r--r--Dockerfile11
-rwxr-xr-xdeploy.sh2
4 files changed, 27 insertions, 1 deletions
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