aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2022-07-18 10:34:42 +0530
committerBobby <[email protected]>2022-07-18 10:34:42 +0530
commit31f1050179a3bcfdca14931cd4a11881477d528d (patch)
tree420b65b50dc076d97ae331e5408cec7c9d40fcd1
parent1fd250c061b7ce6f4ad4fb556fd9a10a10d5eb01 (diff)
downloadthatcomputerscientist-31f1050179a3bcfdca14931cd4a11881477d528d.tar.xz
thatcomputerscientist-31f1050179a3bcfdca14931cd4a11881477d528d.zip
Added Fly Deploy Workflow
-rw-r--r--.github/workflows/main.yml12
-rw-r--r--Dockerfile26
-rw-r--r--fly.toml12
3 files changed, 43 insertions, 7 deletions
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
new file mode 100644
index 00000000..f6103c37
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,12 @@
+name: Fly Deploy
+on: [push]
+env:
+ FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
+jobs:
+ deploy:
+ name: Deploy app
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: superfly/flyctl-actions/setup-flyctl@master
+ - run: flyctl deploy --remote-only \ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 00000000..1f8878aa
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,26 @@
+ARG PYTHON_VERSION=3.7
+
+FROM python:${PYTHON_VERSION}
+
+RUN apt-get update && apt-get install -y \
+ python3-pip \
+ python3-venv \
+ python3-dev \
+ python3-setuptools \
+ python3-wheel
+
+RUN mkdir -p /app
+WORKDIR /app
+
+COPY requirements.txt .
+RUN pip install -r requirements.txt
+
+COPY . .
+
+RUN python manage.py collectstatic --noinput
+
+
+EXPOSE 8080
+
+# replace APP_NAME with module name
+CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "thatcomputerscientist.wsgi"]
diff --git a/fly.toml b/fly.toml
index d0641f69..52ab8470 100644
--- a/fly.toml
+++ b/fly.toml
@@ -1,15 +1,10 @@
-# fly.toml file generated for thatcomputerscientist on 2022-06-02T13:51:48+05:30
+# fly.toml file generated for thatcomputerscientist on 2022-07-18T10:28:35+05:30
app = "thatcomputerscientist"
-
kill_signal = "SIGINT"
kill_timeout = 5
processes = []
-[build]
- # builder = "heroku/buildpacks:20"
- dockerfile = "Dockerfile"
-
[env]
PORT = "8080"
@@ -23,7 +18,6 @@ processes = []
processes = ["app"]
protocol = "tcp"
script_checks = []
-
[services.concurrency]
hard_limit = 25
soft_limit = 20
@@ -43,3 +37,7 @@ processes = []
interval = "15s"
restart_limit = 0
timeout = "2s"
+
+[[statics]]
+ guest_path = "/app/public"
+ url_prefix = "/static/"