From a7b562135ccd33acea520ce81470912856cd7145 Mon Sep 17 00:00:00 2001 From: Skylar Grant Date: Fri, 4 Mar 2022 23:29:38 -0500 Subject: [PATCH] Add dockerfile, disable github actions --- .dockerignore | 2 ++ .github/workflows/dev_deploy.yaml | 46 +++++++++++++++--------------- .github/workflows/prod_deploy.yaml | 46 +++++++++++++++--------------- Dockerfile | 8 ++++++ 4 files changed, 56 insertions(+), 46 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5171c54 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log \ No newline at end of file diff --git a/.github/workflows/dev_deploy.yaml b/.github/workflows/dev_deploy.yaml index 2eec3a5..ae93bf1 100644 --- a/.github/workflows/dev_deploy.yaml +++ b/.github/workflows/dev_deploy.yaml @@ -1,25 +1,25 @@ -name: NodBot Dev Deploy +# name: NodBot Dev Deploy -on: - push: # tells github to run this on any push to the dev branch - branches: - - dev +# on: +# push: # tells github to run this on any push to the dev branch +# branches: +# - dev -jobs: - deploy: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/dev' # we tell Github to only execute this step if we're on our dev branch - steps: - - name: Deploying to Probey - uses: appleboy/ssh-action@master # An action made to control Linux servers - with: # We set all our secrets here for the action, these won't be shown in the action logs - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - cd nodbot-dev # we move into our app's folder - git pull # we pull any changes from git - npm prune # we remove any unused dependencies - npm install # we install any missing dependencies - pm2 reload nodbot-dev # we reload the app via PM2 +# jobs: +# deploy: +# runs-on: ubuntu-latest +# if: github.ref == 'refs/heads/dev' # we tell Github to only execute this step if we're on our dev branch +# steps: +# - name: Deploying to Probey +# uses: appleboy/ssh-action@master # An action made to control Linux servers +# with: # We set all our secrets here for the action, these won't be shown in the action logs +# host: ${{ secrets.HOST }} +# username: ${{ secrets.USERNAME }} +# key: ${{ secrets.KEY }} +# port: ${{ secrets.PORT }} +# script: | +# cd nodbot-dev # we move into our app's folder +# git pull # we pull any changes from git +# npm prune # we remove any unused dependencies +# npm install # we install any missing dependencies +# pm2 reload nodbot-dev # we reload the app via PM2 diff --git a/.github/workflows/prod_deploy.yaml b/.github/workflows/prod_deploy.yaml index 5f05f3e..edc92cd 100644 --- a/.github/workflows/prod_deploy.yaml +++ b/.github/workflows/prod_deploy.yaml @@ -1,25 +1,25 @@ -name: NodBot Production Deploy +# name: NodBot Production Deploy -on: - push: # tells github to run this on any push to the dev branch - branches: - - main +# on: +# push: # tells github to run this on any push to the dev branch +# branches: +# - main -jobs: - deploy: - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch - steps: - - name: Deploying to Probey - uses: appleboy/ssh-action@master # An action made to control Linux servers - with: # We set all our secrets here for the action, these won't be shown in the action logs - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - key: ${{ secrets.KEY }} - port: ${{ secrets.PORT }} - script: | - cd nodbot # we move into our app's folder - git pull # we pull any changes from git - npm prune # we remove any unused dependencies - npm install # we install any missing dependencies - pm2 reload nodbot # we reload the app via PM2 +# jobs: +# deploy: +# runs-on: ubuntu-latest +# if: github.ref == 'refs/heads/main' # we tell Github to only execute this step if we're on our main branch +# steps: +# - name: Deploying to Probey +# uses: appleboy/ssh-action@master # An action made to control Linux servers +# with: # We set all our secrets here for the action, these won't be shown in the action logs +# host: ${{ secrets.HOST }} +# username: ${{ secrets.USERNAME }} +# key: ${{ secrets.KEY }} +# port: ${{ secrets.PORT }} +# script: | +# cd nodbot # we move into our app's folder +# git pull # we pull any changes from git +# npm prune # we remove any unused dependencies +# npm install # we install any missing dependencies +# pm2 reload nodbot # we reload the app via PM2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a0b785a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM node:16 +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +COPY package.json ./ +RUN npm install +COPY . . +CMD [ "node", "main.js" ] \ No newline at end of file