diff options
| -rw-r--r-- | .github/workflows/main.yml | 12 | ||||
| -rw-r--r-- | Dockerfile | 26 | ||||
| -rw-r--r-- | fly.toml | 12 |
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"] @@ -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/" |
