Skip to content

Commit

Permalink
Merge pull request #27 from softwarecrafts/main
Browse files Browse the repository at this point in the history
Dokku setup for deployment and hosting
  • Loading branch information
nanorepublica authored May 15, 2024
2 parents bfc6432 + a649f74 commit efea447
Show file tree
Hide file tree
Showing 8 changed files with 561 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
heroku/nodejs
heroku/python
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: 'deploy'

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest
# container: ubuntu:latest
steps:
- name: Cloning repo
uses: actions/checkout@v4
with:
fetch-depth: 0
# - name: install curl dependency
# run: apt-get update && apt-get install curl sudo bind9-host 2ping -y
# - name: Tailscale
# uses: tailscale/github-action@v2
# with:
# oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
# oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
# tags: tag:ci
# tailscaled-args: --tun=userspace-networking --socks5-server=localhost:1055 --outbound-http-proxy-listen=localhost:1055
# - name: Test Connectivity
# run: |
# tailscale status
# ls -al /github/home/
# pwd
# # host aws-dokku
# # ping -c 10 aws-dokku
- name: AWS Security Group Add IP
uses: sohelamin/[email protected]
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_ACCESS_SECRET_KEY }}
aws-region: 'eu-west-2'
aws-security-group-id: 'sg-0e2a639b321457151'
- name: Push to dokku
uses: dokku/github-action@master
with:
git_remote_url: 'ssh://[email protected]:22/django-social'
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
branch: 'main'
git_push_flags: '--force -vvv'
ssh_host_key: ${{ secrets.SSH_HOST_KEY }}
trace: '1'
2 changes: 2 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: gunicorn djangosocial.wsgi:application --bind 0.0.0.0:$PORT --timeout 300 --chdir django
release: python django/manage.py migrate
20 changes: 20 additions & 0 deletions django/djangosocial/settings/production.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
import os
from .base import *

import dj_database_url


try:
from .local import *
except ImportError:
pass

STATIC_ROOT = BASE_DIR / ".." / "static"
MIDDLEWARE += [
"whitenoise.middleware.WhiteNoiseMiddleware",
]


ALLOWED_HOSTS = os.environ.get("ALLOWED_HOSTS").split(",")


DATABASES = {
"default": dj_database_url.config(
conn_max_age=600,
conn_health_checks=True,
),
}
4 changes: 3 additions & 1 deletion django/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@ Django>=4.2.5,<5.0
django-debug-toolbar
gunicorn~=21.0
psycopg[binary]~=3.1.12
wagtail~=5.2.0
wagtail>=5.1.0,<6
whitenoise==6.6.0
dj-database-url==2.1.0
27 changes: 19 additions & 8 deletions django/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# This file is autogenerated by pip-compile with Python 3.12
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --generate-hashes
Expand Down Expand Up @@ -116,11 +116,16 @@ defusedxml==0.7.1 \
--hash=sha256:1bb3032db185915b62d7c6209c5a8792be6a32ab2fedacc84e01b52c51aa3e69 \
--hash=sha256:a352e7e428770286cc899e2542b6cdaedb2b4953ff269a210103ec58f6198a61
# via willow
django==4.2.7 \
--hash=sha256:8e0f1c2c2786b5c0e39fe1afce24c926040fad47c8ea8ad30aaf1188df29fc41 \
--hash=sha256:e1d37c51ad26186de355cbcec16613ebdabfa9689bbade9c538835205a8abbe9
dj-database-url==2.1.0 \
--hash=sha256:04bc34b248d4c21aaa13e4ab419ae6575ef5f10f3df735ce7da97722caa356e0 \
--hash=sha256:f2042cefe1086e539c9da39fad5ad7f61173bf79665e69bf7e4de55fa88b135f
# via -r requirements.in
django==4.2.6 \
--hash=sha256:08f41f468b63335aea0d904c5729e0250300f6a1907bf293a65499496cdbc68f \
--hash=sha256:a64d2487cdb00ad7461434320ccc38e60af9c404773a2f95ab0093b4453a3215
# via
# -r requirements.in
# dj-database-url
# django-debug-toolbar
# django-filter
# django-modelcluster
Expand Down Expand Up @@ -409,10 +414,12 @@ telepath==0.3.1 \
typing-extensions==4.8.0 \
--hash=sha256:8f92fc8806f9a6b641eaa5318da32b44d401efaac0f6678c9bc448ba3605faa0 \
--hash=sha256:df8e4339e9cb77357558cbdbceca33c303714cf861d1eef15e1070055ae8b7ef
# via psycopg
urllib3==2.1.0 \
--hash=sha256:55901e917a5896a349ff771be919f8bd99aff50b79fe58fec595eb37bbc56bb3 \
--hash=sha256:df7aa8afb0148fa78488e7899b2c59b5f4ffcfa82e6c54ccb9dd37c1d7b52d54
# via
# dj-database-url
# psycopg
urllib3==2.0.7 \
--hash=sha256:c97dfde1f7bd43a71c8d2a58e369e9b2bf692d1334ea9f9cae55add7d0dd0f84 \
--hash=sha256:fdb6d215c776278489906c2f8916e6e7d4f5a9b602ccbcfdf7f016fc8da0596e
# via requests
wagtail==5.2 \
--hash=sha256:695b2af9c42ab7b293f489abc9e3dcaa2cbe28977fe0b730683c43b46e0f75d1 \
Expand All @@ -422,6 +429,10 @@ webencodings==0.5.1 \
--hash=sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78 \
--hash=sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923
# via html5lib
whitenoise==6.6.0 \
--hash=sha256:8998f7370973447fac1e8ef6e8ded2c5209a7b1f67c1012866dbcd09681c3251 \
--hash=sha256:b1f9db9bf67dc183484d760b99f4080185633136a273a03f6436034a41064146
# via -r requirements.in
willow[heif]==1.6.2 \
--hash=sha256:957a4af8a7733e116a65eca34da11afe3fd52ffdb397494c8823901c25863787 \
--hash=sha256:e2d0450fd78ab19052d0478b888ef163e3264e8dcd1af002dd691458db98056f
Expand Down
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "djangosocialtw",
"version": "1.0.0",
"description": "Tailwind config for Django.social",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/djangosocialteam/djangosocial.git"
},
"author": "Django.social Team",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/djangosocialteam/djangosocial/issues"
},
"homepage": "https://github.com/djangosocialteam/djangosocial#readme",
"devDependencies": {
"prettier": "^3.0.3",
"prettier-plugin-tailwindcss": "^0.5.6",
"tailwindcss": "^3.3.3"
},
"dependencies": {
"@tailwindcss/forms": "^0.5.6"
}
}
Loading

0 comments on commit efea447

Please sign in to comment.