diff --git a/.dockerignore b/.dockerignore index 3c20820db..ce4fe20cf 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,3 +2,4 @@ node_modules/ app/client/build/ app/client/plugins/ *.log +**/.env* diff --git a/.github/workflows/fly-deploy.yml b/.github/workflows/fly-deploy.yml new file mode 100644 index 000000000..b0c246ede --- /dev/null +++ b/.github/workflows/fly-deploy.yml @@ -0,0 +1,18 @@ +# See https://fly.io/docs/app-guides/continuous-deployment-with-github-actions/ + +name: Fly Deploy +on: + push: + branches: + - main +jobs: + deploy: + name: Deploy app + runs-on: ubuntu-latest + concurrency: deploy-group # optional: ensure only one action runs at a time + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Dockerfile b/Dockerfile index e4863d28f..96f913736 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,11 @@ FROM node:10.17.0-buster-slim +# Install Python 2 +RUN apt-get update && apt-get install -y python2 + +# Install make and build-essential +RUN apt-get update && apt-get install -y make build-essential + WORKDIR /usr/app/src EXPOSE 3000 diff --git a/app.js b/app.js index 878e19ae7..e663da020 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,10 @@ var adminConfig = require("./config/admin"); var app = express(); // Connect to mongodb -mongoose.connect(database); +mongoose.connect(database, { + useNewUrlParser: true, + useUnifiedTopology: true +}); app.use(morgan("dev")); diff --git a/fly.toml b/fly.toml new file mode 100644 index 000000000..0c36949d5 --- /dev/null +++ b/fly.toml @@ -0,0 +1,22 @@ +# fly.toml app configuration file generated for quill on 2024-07-20T01:18:12-07:00 +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'quill' +primary_region = 'sjc' + +[build] + +[http_service] + internal_port = 3000 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1