From e202e426d4588e9deae09c0e1c249333b0aef88d Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 25 Sep 2023 13:09:34 -0400 Subject: [PATCH 1/7] First shot at dockerize --- Dockerfile | 13 + Dockerfile.nextupbot | 13 + Pipfile | 22 - Pipfile.lock | 549 ------------------ README.md | 20 + discoreg/discoreg/settings.py | 2 - .../templates/registrations/index.html | 2 +- docker-compose.yml | 21 + docker-entrypoint.sh | 13 + example.env | 1 + requirements.txt | 34 ++ 11 files changed, 116 insertions(+), 574 deletions(-) create mode 100644 Dockerfile create mode 100644 Dockerfile.nextupbot delete mode 100644 Pipfile delete mode 100644 Pipfile.lock create mode 100644 docker-compose.yml create mode 100644 docker-entrypoint.sh create mode 100644 requirements.txt diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..944fc2d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM python:3.8 + +ENV PYTHONUNBUFFERED 1 + +WORKDIR /discoreg +EXPOSE 8000 + +COPY requirements.txt /discoreg +RUN pip3 install -r requirements.txt --no-cache-dir +COPY . /discoreg + +ENTRYPOINT ["/discoreg/docker-entrypoint.sh"] +CMD ["sh"] diff --git a/Dockerfile.nextupbot b/Dockerfile.nextupbot new file mode 100644 index 0000000..0da1661 --- /dev/null +++ b/Dockerfile.nextupbot @@ -0,0 +1,13 @@ +FROM python:3.8 + +ENV PYTHONUNBUFFERED 1 + +WORKDIR /discoreg +EXPOSE 8000 + +COPY requirements.txt /discoreg +RUN pip3 install -r requirements.txt --no-cache-dir +COPY . /discoreg + +ENTRYPOINT ["python3"] +CMD ["discoreg/manage.py", "nextupbot"] diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 0172e5a..0000000 --- a/Pipfile +++ /dev/null @@ -1,22 +0,0 @@ -[[source]] -name = "pypi" -url = "https://pypi.org/simple" -verify_ssl = true - -[dev-packages] -black = "==19.10b0" -ipython = "*" - -[packages] -django = "*" -requests-oauthlib = "*" -discord-py = "*" -django-heroku = "*" -psycopg2 = "*" -gunicorn = "*" -bleach = "*" -raygun4py = "*" -pyyaml = "*" - -[requires] -python_version = "3.8" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index cba79d9..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,549 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "2486d750be696646c8a2678ffd2cb5e3f9b1a78b173ef25391ce94ea53f27ba5" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.8" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "aiohttp": { - "hashes": [ - "sha256:1e984191d1ec186881ffaed4581092ba04f7c61582a177b187d3a2f07ed9719e", - "sha256:259ab809ff0727d0e834ac5e8a283dc5e3e0ecc30c4d80b3cd17a4139ce1f326", - "sha256:2f4d1a4fdce595c947162333353d4a44952a724fba9ca3205a3df99a33d1307a", - "sha256:32e5f3b7e511aa850829fbe5aa32eb455e5534eaa4b1ce93231d00e2f76e5654", - "sha256:344c780466b73095a72c616fac5ea9c4665add7fc129f285fbdbca3cccf4612a", - "sha256:460bd4237d2dbecc3b5ed57e122992f60188afe46e7319116da5eb8a9dfedba4", - "sha256:4c6efd824d44ae697814a2a85604d8e992b875462c6655da161ff18fd4f29f17", - "sha256:50aaad128e6ac62e7bf7bd1f0c0a24bc968a0c0590a726d5a955af193544bcec", - "sha256:6206a135d072f88da3e71cc501c59d5abffa9d0bb43269a6dcd28d66bfafdbdd", - "sha256:65f31b622af739a802ca6fd1a3076fd0ae523f8485c52924a89561ba10c49b48", - "sha256:ae55bac364c405caa23a4f2d6cfecc6a0daada500274ffca4a9230e7129eac59", - "sha256:b778ce0c909a2653741cb4b1ac7015b5c130ab9c897611df43ae6a58523cb965" - ], - "version": "==3.6.2" - }, - "asgiref": { - "hashes": [ - "sha256:7e51911ee147dd685c3c8b805c0ad0cb58d360987b56953878f8c06d2d1c6f1a", - "sha256:9fc6fb5d39b8af147ba40765234fa822b39818b12cc80b35ad9b0cef3a476aed" - ], - "version": "==3.2.10" - }, - "async-timeout": { - "hashes": [ - "sha256:0c3c816a028d47f659d6ff5c745cb2acf1f966da1fe5c19c77a70282b25f4c5f", - "sha256:4291ca197d287d274d0b6cb5d6f8f8f82d434ed288f962539ff18cc9012f9ea3" - ], - "version": "==3.0.1" - }, - "attrs": { - "hashes": [ - "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", - "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" - ], - "version": "==19.3.0" - }, - "bleach": { - "hashes": [ - "sha256:2bce3d8fab545a6528c8fa5d9f9ae8ebc85a56da365c7f85180bfe96a35ef22f", - "sha256:3c4c520fdb9db59ef139915a5db79f8b51bc2a7257ea0389f30c846883430a4b" - ], - "index": "pypi", - "version": "==3.1.5" - }, - "blinker": { - "hashes": [ - "sha256:471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6" - ], - "version": "==1.4" - }, - "certifi": { - "hashes": [ - "sha256:5930595817496dd21bb8dc35dad090f1c2cd0adfaf21204bf6732ca5d8ee34d3", - "sha256:8fc0819f1f30ba15bdb34cceffb9ef04d99f420f68eb75d901e9560b8749fc41" - ], - "version": "==2020.6.20" - }, - "chardet": { - "hashes": [ - "sha256:84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae", - "sha256:fc323ffcaeaed0e0a02bf4d117757b98aed530d9ed4531e3e15460124c106691" - ], - "version": "==3.0.4" - }, - "discord-py": { - "hashes": [ - "sha256:8ef58d6fc1e66903bc00ae79c4c09a38aa71043e88a83da4d2e8b9b1c9f9b9e2" - ], - "index": "pypi", - "version": "==1.3.4" - }, - "dj-database-url": { - "hashes": [ - "sha256:4aeaeb1f573c74835b0686a2b46b85990571159ffc21aa57ecd4d1e1cb334163", - "sha256:851785365761ebe4994a921b433062309eb882fedd318e1b0fcecc607ed02da9" - ], - "version": "==0.5.0" - }, - "django": { - "hashes": [ - "sha256:31a5fbbea5fc71c99e288ec0b2f00302a0a92c44b13ede80b73a6a4d6d205582", - "sha256:5457fc953ec560c5521b41fad9e6734a4668b7ba205832191bbdff40ec61073c" - ], - "index": "pypi", - "version": "==3.0.8" - }, - "django-heroku": { - "hashes": [ - "sha256:2bc690aab89eedbe01311752320a9a12e7548e3b0ed102681acc5736a41a4762", - "sha256:6af4bc3ae4a9b55eaad6dbe5164918982d2762661aebc9f83d9fa49f6009514e" - ], - "index": "pypi", - "version": "==0.3.1" - }, - "gunicorn": { - "hashes": [ - "sha256:1904bb2b8a43658807108d59c3f3d56c2b6121a701161de0ddf9ad140073c626", - "sha256:cd4a810dd51bf497552cf3f863b575dabd73d6ad6a91075b65936b151cbf4f9c" - ], - "index": "pypi", - "version": "==20.0.4" - }, - "idna": { - "hashes": [ - "sha256:b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6", - "sha256:b97d804b1e9b523befed77c48dacec60e6dcb0b5391d57af6a65a312a90648c0" - ], - "version": "==2.10" - }, - "importlib-metadata": { - "hashes": [ - "sha256:90bb658cdbbf6d1735b6341ce708fc7024a3e14e99ffdc5783edea9f9b077f83", - "sha256:dc15b2969b4ce36305c51eebe62d418ac7791e9a157911d58bfb1f9ccd8e2070" - ], - "version": "==1.7.0" - }, - "jsonpickle": { - "hashes": [ - "sha256:8919c166bac0574e3d74425c7559434062002d9dfc0ac2afa6dc746ba4a19439", - "sha256:e8d4b7cd0bd6826001a74377df1079a76ad8bae0f909282de2554164c837c8ba" - ], - "version": "==1.4.1" - }, - "multidict": { - "hashes": [ - "sha256:1ece5a3369835c20ed57adadc663400b5525904e53bae59ec854a5d36b39b21a", - "sha256:275ca32383bc5d1894b6975bb4ca6a7ff16ab76fa622967625baeebcf8079000", - "sha256:3750f2205b800aac4bb03b5ae48025a64e474d2c6cc79547988ba1d4122a09e2", - "sha256:4538273208e7294b2659b1602490f4ed3ab1c8cf9dbdd817e0e9db8e64be2507", - "sha256:5141c13374e6b25fe6bf092052ab55c0c03d21bd66c94a0e3ae371d3e4d865a5", - "sha256:51a4d210404ac61d32dada00a50ea7ba412e6ea945bbe992e4d7a595276d2ec7", - "sha256:5cf311a0f5ef80fe73e4f4c0f0998ec08f954a6ec72b746f3c179e37de1d210d", - "sha256:6513728873f4326999429a8b00fc7ceddb2509b01d5fd3f3be7881a257b8d463", - "sha256:7388d2ef3c55a8ba80da62ecfafa06a1c097c18032a501ffd4cabbc52d7f2b19", - "sha256:9456e90649005ad40558f4cf51dbb842e32807df75146c6d940b6f5abb4a78f3", - "sha256:c026fe9a05130e44157b98fea3ab12969e5b60691a276150db9eda71710cd10b", - "sha256:d14842362ed4cf63751648e7672f7174c9818459d169231d03c56e84daf90b7c", - "sha256:e0d072ae0f2a179c375f67e3da300b47e1a83293c554450b29c900e50afaae87", - "sha256:f07acae137b71af3bb548bd8da720956a3bc9f9a0b87733e0899226a2317aeb7", - "sha256:fbb77a75e529021e7c4a8d4e823d88ef4d23674a202be4f5addffc72cbb91430", - "sha256:fcfbb44c59af3f8ea984de67ec7c306f618a3ec771c2843804069917a8f2e255", - "sha256:feed85993dbdb1dbc29102f50bca65bdc68f2c0c8d352468c25b54874f23c39d" - ], - "version": "==4.7.6" - }, - "oauthlib": { - "hashes": [ - "sha256:bee41cc35fcca6e988463cacc3bcb8a96224f470ca547e697b604cc697b2f889", - "sha256:df884cd6cbe20e32633f1db1072e9356f53638e4361bef4e8b03c9127c9328ea" - ], - "version": "==3.1.0" - }, - "packaging": { - "hashes": [ - "sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8", - "sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181" - ], - "version": "==20.4" - }, - "psycopg2": { - "hashes": [ - "sha256:132efc7ee46a763e68a815f4d26223d9c679953cd190f1f218187cb60decf535", - "sha256:2327bf42c1744a434ed8ed0bbaa9168cac7ee5a22a9001f6fc85c33b8a4a14b7", - "sha256:27c633f2d5db0fc27b51f1b08f410715b59fa3802987aec91aeb8f562724e95c", - "sha256:2c0afb40cfb4d53487ee2ebe128649028c9a78d2476d14a67781e45dc287f080", - "sha256:2df2bf1b87305bd95eb3ac666ee1f00a9c83d10927b8144e8e39644218f4cf81", - "sha256:440a3ea2c955e89321a138eb7582aa1d22fe286c7d65e26a2c5411af0a88ae72", - "sha256:6a471d4d2a6f14c97a882e8d3124869bc623f3df6177eefe02994ea41fd45b52", - "sha256:6b306dae53ec7f4f67a10942cf8ac85de930ea90e9903e2df4001f69b7833f7e", - "sha256:a0984ff49e176062fcdc8a5a2a670c9bb1704a2f69548bce8f8a7bad41c661bf", - "sha256:ac5b23d0199c012ad91ed1bbb971b7666da651c6371529b1be8cbe2a7bf3c3a9", - "sha256:acf56d564e443e3dea152efe972b1434058244298a94348fc518d6dd6a9fb0bb", - "sha256:d3b29d717d39d3580efd760a9a46a7418408acebbb784717c90d708c9ed5f055", - "sha256:f7d46240f7a1ae1dd95aab38bd74f7428d46531f69219954266d669da60c0818" - ], - "index": "pypi", - "version": "==2.8.5" - }, - "pyparsing": { - "hashes": [ - "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1", - "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b" - ], - "version": "==2.4.7" - }, - "pytz": { - "hashes": [ - "sha256:a494d53b6d39c3c6e44c3bec237336e14305e4f29bbf800b599253057fbb79ed", - "sha256:c35965d010ce31b23eeb663ed3cc8c906275d6be1a34393a1d73a41febf4a048" - ], - "version": "==2020.1" - }, - "pyyaml": { - "hashes": [ - "sha256:06a0d7ba600ce0b2d2fe2e78453a470b5a6e000a985dd4a4e54e436cc36b0e97", - "sha256:240097ff019d7c70a4922b6869d8a86407758333f02203e0fc6ff79c5dcede76", - "sha256:4f4b913ca1a7319b33cfb1369e91e50354d6f07a135f3b901aca02aa95940bd2", - "sha256:69f00dca373f240f842b2931fb2c7e14ddbacd1397d57157a9b005a6a9942648", - "sha256:73f099454b799e05e5ab51423c7bcf361c58d3206fa7b0d555426b1f4d9a3eaf", - "sha256:74809a57b329d6cc0fdccee6318f44b9b8649961fa73144a98735b0aaf029f1f", - "sha256:7739fc0fa8205b3ee8808aea45e968bc90082c10aef6ea95e855e10abf4a37b2", - "sha256:95f71d2af0ff4227885f7a6605c37fd53d3a106fcab511b8860ecca9fcf400ee", - "sha256:b8eac752c5e14d3eca0e6dd9199cd627518cb5ec06add0de9d32baeee6fe645d", - "sha256:cc8955cfbfc7a115fa81d85284ee61147059a753344bc51098f3ccd69b0d7e0c", - "sha256:d13155f591e6fcc1ec3b30685d50bf0711574e2c0dfffd7644babf8b5102ca1a" - ], - "index": "pypi", - "version": "==5.3.1" - }, - "raygun4py": { - "hashes": [ - "sha256:9a675da0215df310a929ef8fe4f9f6c7882b3ee44a925d73e5c191fd962d7c4d" - ], - "index": "pypi", - "version": "==4.3.0" - }, - "requests": { - "hashes": [ - "sha256:b3559a131db72c33ee969480840fff4bb6dd111de7dd27c8ee1f820f4f00231b", - "sha256:fe75cc94a9443b9246fc7049224f75604b113c36acb93f87b80ed42c44cbb898" - ], - "version": "==2.24.0" - }, - "requests-oauthlib": { - "hashes": [ - "sha256:7f71572defaecd16372f9006f33c2ec8c077c3cfa6f5911a9a90202beb513f3d", - "sha256:b4261601a71fd721a8bd6d7aa1cc1d6a8a93b4a9f5e96626f8e4d91e8beeaa6a" - ], - "index": "pypi", - "version": "==1.3.0" - }, - "six": { - "hashes": [ - "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", - "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" - ], - "version": "==1.15.0" - }, - "sqlparse": { - "hashes": [ - "sha256:022fb9c87b524d1f7862b3037e541f68597a730a8843245c349fc93e1643dc4e", - "sha256:e162203737712307dfe78860cc56c8da8a852ab2ee33750e33aeadf38d12c548" - ], - "version": "==0.3.1" - }, - "urllib3": { - "hashes": [ - "sha256:91056c15fa70756691db97756772bb1eb9678fa585d9184f24534b100dc60f4a", - "sha256:e7983572181f5e1522d9c98453462384ee92a0be7fac5f1413a1e35c56cc0461" - ], - "version": "==1.25.10" - }, - "webencodings": { - "hashes": [ - "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78", - "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923" - ], - "version": "==0.5.1" - }, - "websockets": { - "hashes": [ - "sha256:0e4fb4de42701340bd2353bb2eee45314651caa6ccee80dbd5f5d5978888fed5", - "sha256:1d3f1bf059d04a4e0eb4985a887d49195e15ebabc42364f4eb564b1d065793f5", - "sha256:20891f0dddade307ffddf593c733a3fdb6b83e6f9eef85908113e628fa5a8308", - "sha256:295359a2cc78736737dd88c343cd0747546b2174b5e1adc223824bcaf3e164cb", - "sha256:2db62a9142e88535038a6bcfea70ef9447696ea77891aebb730a333a51ed559a", - "sha256:3762791ab8b38948f0c4d281c8b2ddfa99b7e510e46bd8dfa942a5fff621068c", - "sha256:3db87421956f1b0779a7564915875ba774295cc86e81bc671631379371af1170", - "sha256:3ef56fcc7b1ff90de46ccd5a687bbd13a3180132268c4254fc0fa44ecf4fc422", - "sha256:4f9f7d28ce1d8f1295717c2c25b732c2bc0645db3215cf757551c392177d7cb8", - "sha256:5c01fd846263a75bc8a2b9542606927cfad57e7282965d96b93c387622487485", - "sha256:5c65d2da8c6bce0fca2528f69f44b2f977e06954c8512a952222cea50dad430f", - "sha256:751a556205d8245ff94aeef23546a1113b1dd4f6e4d102ded66c39b99c2ce6c8", - "sha256:7ff46d441db78241f4c6c27b3868c9ae71473fe03341340d2dfdbe8d79310acc", - "sha256:965889d9f0e2a75edd81a07592d0ced54daa5b0785f57dc429c378edbcffe779", - "sha256:9b248ba3dd8a03b1a10b19efe7d4f7fa41d158fdaa95e2cf65af5a7b95a4f989", - "sha256:9bef37ee224e104a413f0780e29adb3e514a5b698aabe0d969a6ba426b8435d1", - "sha256:c1ec8db4fac31850286b7cd3b9c0e1b944204668b8eb721674916d4e28744092", - "sha256:c8a116feafdb1f84607cb3b14aa1418424ae71fee131642fc568d21423b51824", - "sha256:ce85b06a10fc65e6143518b96d3dca27b081a740bae261c2fb20375801a9d56d", - "sha256:d705f8aeecdf3262379644e4b55107a3b55860eb812b673b28d0fbc347a60c55", - "sha256:e898a0863421650f0bebac8ba40840fc02258ef4714cb7e1fd76b6a6354bda36", - "sha256:f8a7bff6e8664afc4e6c28b983845c5bc14965030e3fb98789734d416af77c4b" - ], - "version": "==8.1" - }, - "whitenoise": { - "hashes": [ - "sha256:60154b976a13901414a25b0273a841145f77eb34a141f9ae032a0ace3e4d5b27", - "sha256:6dd26bfda3af29177d8ab7333a0c7b7642eb615ce83764f4d15a9aecda3201c4" - ], - "version": "==5.1.0" - }, - "yarl": { - "hashes": [ - "sha256:0c2ab325d33f1b824734b3ef51d4d54a54e0e7a23d13b86974507602334c2cce", - "sha256:0ca2f395591bbd85ddd50a82eb1fde9c1066fafe888c5c7cc1d810cf03fd3cc6", - "sha256:2098a4b4b9d75ee352807a95cdf5f10180db903bc5b7270715c6bbe2551f64ce", - "sha256:25e66e5e2007c7a39541ca13b559cd8ebc2ad8fe00ea94a2aad28a9b1e44e5ae", - "sha256:26d7c90cb04dee1665282a5d1a998defc1a9e012fdca0f33396f81508f49696d", - "sha256:308b98b0c8cd1dfef1a0311dc5e38ae8f9b58349226aa0533f15a16717ad702f", - "sha256:3ce3d4f7c6b69c4e4f0704b32eca8123b9c58ae91af740481aa57d7857b5e41b", - "sha256:58cd9c469eced558cd81aa3f484b2924e8897049e06889e8ff2510435b7ef74b", - "sha256:5b10eb0e7f044cf0b035112446b26a3a2946bca9d7d7edb5e54a2ad2f6652abb", - "sha256:6faa19d3824c21bcbfdfce5171e193c8b4ddafdf0ac3f129ccf0cdfcb083e462", - "sha256:944494be42fa630134bf907714d40207e646fd5a94423c90d5b514f7b0713fea", - "sha256:a161de7e50224e8e3de6e184707476b5a989037dcb24292b391a3d66ff158e70", - "sha256:a4844ebb2be14768f7994f2017f70aca39d658a96c786211be5ddbe1c68794c1", - "sha256:c2b509ac3d4b988ae8769901c66345425e361d518aecbe4acbfc2567e416626a", - "sha256:c9959d49a77b0e07559e579f38b2f3711c2b8716b8410b320bf9713013215a1b", - "sha256:d8cdee92bc930d8b09d8bd2043cedd544d9c8bd7436a77678dd602467a993080", - "sha256:e15199cdb423316e15f108f51249e44eb156ae5dba232cb73be555324a1d49c2" - ], - "version": "==1.4.2" - }, - "zipp": { - "hashes": [ - "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b", - "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96" - ], - "version": "==3.1.0" - } - }, - "develop": { - "appdirs": { - "hashes": [ - "sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41", - "sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128" - ], - "version": "==1.4.4" - }, - "appnope": { - "hashes": [ - "sha256:5b26757dc6f79a3b7dc9fab95359328d5747fcb2409d331ea66d0272b90ab2a0", - "sha256:8b995ffe925347a2138d7ac0fe77155e4311a0ea6d6da4f5128fe4b3cbe5ed71" - ], - "markers": "sys_platform == 'darwin'", - "version": "==0.1.0" - }, - "attrs": { - "hashes": [ - "sha256:08a96c641c3a74e44eb59afb61a24f2cb9f4d7188748e76ba4bb5edfa3cb7d1c", - "sha256:f7b7ce16570fe9965acd6d30101a28f62fb4a7f9e926b3bbc9b61f8b04247e72" - ], - "version": "==19.3.0" - }, - "backcall": { - "hashes": [ - "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e", - "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255" - ], - "version": "==0.2.0" - }, - "black": { - "hashes": [ - "sha256:1b30e59be925fafc1ee4565e5e08abef6b03fe455102883820fe5ee2e4734e0b", - "sha256:c2edb73a08e9e0e6f65a0e6af18b059b8b1cdd5bef997d7a0b181df93dc81539" - ], - "index": "pypi", - "version": "==19.10b0" - }, - "click": { - "hashes": [ - "sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a", - "sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc" - ], - "version": "==7.1.2" - }, - "decorator": { - "hashes": [ - "sha256:41fa54c2a0cc4ba648be4fd43cff00aedf5b9465c9bf18d64325bc225f08f760", - "sha256:e3a62f0520172440ca0dcc823749319382e377f37f140a0b99ef45fecb84bfe7" - ], - "version": "==4.4.2" - }, - "ipython": { - "hashes": [ - "sha256:2dbcc8c27ca7d3cfe4fcdff7f45b27f9a8d3edfa70ff8024a71c7a8eb5f09d64", - "sha256:9f4fcb31d3b2c533333893b9172264e4821c1ac91839500f31bd43f2c59b3ccf" - ], - "index": "pypi", - "version": "==7.16.1" - }, - "ipython-genutils": { - "hashes": [ - "sha256:72dd37233799e619666c9f639a9da83c34013a73e8bbc79a7a6348d93c61fab8", - "sha256:eb2e116e75ecef9d4d228fdc66af54269afa26ab4463042e33785b887c628ba8" - ], - "version": "==0.2.0" - }, - "jedi": { - "hashes": [ - "sha256:86ed7d9b750603e4ba582ea8edc678657fb4007894a12bcf6f4bb97892f31d20", - "sha256:98cc583fa0f2f8304968199b01b6b4b94f469a1f4a74c1560506ca2a211378b5" - ], - "version": "==0.17.2" - }, - "parso": { - "hashes": [ - "sha256:97218d9159b2520ff45eb78028ba8b50d2bc61dcc062a9682666f2dc4bd331ea", - "sha256:caba44724b994a8a5e086460bb212abc5a8bc46951bf4a9a1210745953622eb9" - ], - "version": "==0.7.1" - }, - "pathspec": { - "hashes": [ - "sha256:7d91249d21749788d07a2d0f94147accd8f845507400749ea19c1ec9054a12b0", - "sha256:da45173eb3a6f2a5a487efba21f050af2b41948be6ab52b6a1e3ff22bb8b7061" - ], - "version": "==0.8.0" - }, - "pexpect": { - "hashes": [ - "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937", - "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c" - ], - "markers": "sys_platform != 'win32'", - "version": "==4.8.0" - }, - "pickleshare": { - "hashes": [ - "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca", - "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56" - ], - "version": "==0.7.5" - }, - "prompt-toolkit": { - "hashes": [ - "sha256:563d1a4140b63ff9dd587bda9557cffb2fe73650205ab6f4383092fb882e7dc8", - "sha256:df7e9e63aea609b1da3a65641ceaf5bc7d05e0a04de5bd45d05dbeffbabf9e04" - ], - "version": "==3.0.5" - }, - "ptyprocess": { - "hashes": [ - "sha256:923f299cc5ad920c68f2bc0bc98b75b9f838b93b599941a6b63ddbc2476394c0", - "sha256:d7cc528d76e76342423ca640335bd3633420dc1366f258cb31d05e865ef5ca1f" - ], - "version": "==0.6.0" - }, - "pygments": { - "hashes": [ - "sha256:647344a061c249a3b74e230c739f434d7ea4d8b1d5f3721bc0f3558049b38f44", - "sha256:ff7a40b4860b727ab48fad6360eb351cc1b33cbf9b15a0f689ca5353e9463324" - ], - "version": "==2.6.1" - }, - "regex": { - "hashes": [ - "sha256:0dc64ee3f33cd7899f79a8d788abfbec168410be356ed9bd30bbd3f0a23a7204", - "sha256:1269fef3167bb52631ad4fa7dd27bf635d5a0790b8e6222065d42e91bede4162", - "sha256:14a53646369157baa0499513f96091eb70382eb50b2c82393d17d7ec81b7b85f", - "sha256:3a3af27a8d23143c49a3420efe5b3f8cf1a48c6fc8bc6856b03f638abc1833bb", - "sha256:46bac5ca10fb748d6c55843a931855e2727a7a22584f302dd9bb1506e69f83f6", - "sha256:4c037fd14c5f4e308b8370b447b469ca10e69427966527edcab07f52d88388f7", - "sha256:51178c738d559a2d1071ce0b0f56e57eb315bcf8f7d4cf127674b533e3101f88", - "sha256:5ea81ea3dbd6767873c611687141ec7b06ed8bab43f68fad5b7be184a920dc99", - "sha256:6961548bba529cac7c07af2fd4d527c5b91bb8fe18995fed6044ac22b3d14644", - "sha256:75aaa27aa521a182824d89e5ab0a1d16ca207318a6b65042b046053cfc8ed07a", - "sha256:7a2dd66d2d4df34fa82c9dc85657c5e019b87932019947faece7983f2089a840", - "sha256:8a51f2c6d1f884e98846a0a9021ff6861bdb98457879f412fdc2b42d14494067", - "sha256:9c568495e35599625f7b999774e29e8d6b01a6fb684d77dee1f56d41b11b40cd", - "sha256:9eddaafb3c48e0900690c1727fba226c4804b8e6127ea409689c3bb492d06de4", - "sha256:bbb332d45b32df41200380fff14712cb6093b61bd142272a10b16778c418e98e", - "sha256:bc3d98f621898b4a9bc7fecc00513eec8f40b5b83913d74ccb445f037d58cd89", - "sha256:c11d6033115dc4887c456565303f540c44197f4fc1a2bfb192224a301534888e", - "sha256:c50a724d136ec10d920661f1442e4a8b010a4fe5aebd65e0c2241ea41dbe93dc", - "sha256:d0a5095d52b90ff38592bbdc2644f17c6d495762edf47d876049cfd2968fbccf", - "sha256:d6cff2276e502b86a25fd10c2a96973fdb45c7a977dca2138d661417f3728341", - "sha256:e46d13f38cfcbb79bfdb2964b0fe12561fe633caf964a77a5f8d4e45fe5d2ef7" - ], - "version": "==2020.7.14" - }, - "six": { - "hashes": [ - "sha256:30639c035cdb23534cd4aa2dd52c3bf48f06e5f4a941509c8bafd8ce11080259", - "sha256:8b74bedcbbbaca38ff6d7491d76f2b06b3592611af620f8426e82dddb04a5ced" - ], - "version": "==1.15.0" - }, - "toml": { - "hashes": [ - "sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f", - "sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88" - ], - "version": "==0.10.1" - }, - "traitlets": { - "hashes": [ - "sha256:70b4c6a1d9019d7b4f6846832288f86998aa3b9207c6821f3578a6a6a467fe44", - "sha256:d023ee369ddd2763310e4c3eae1ff649689440d4ae59d7485eb4cfbbe3e359f7" - ], - "version": "==4.3.3" - }, - "typed-ast": { - "hashes": [ - "sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355", - "sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919", - "sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa", - "sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652", - "sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75", - "sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01", - "sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d", - "sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1", - "sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907", - "sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c", - "sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3", - "sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b", - "sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614", - "sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb", - "sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b", - "sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41", - "sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6", - "sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34", - "sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe", - "sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4", - "sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7" - ], - "version": "==1.4.1" - }, - "wcwidth": { - "hashes": [ - "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784", - "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83" - ], - "version": "==0.2.5" - } - } -} diff --git a/README.md b/README.md index b67810b..f16931a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,23 @@ # discoreg A Django app to manage invites to a Discord server based on conference registrations. + +# Building the docker image(s) + +Ensure Docker Deskop is running locally and run this command. It will build the image and tag it with the name discoreg. (This will only build the web server) + +``` +docker build . -t discoreg +``` + +To build the nextupbot image, point to the specific Dockerfile for it + +``` +docker build . -t nextupbot -f Dockerfile.nextupbot +``` + +# Running disoreg with Docker Compose locally after building the images + +``` +docker-compose up --build +``` diff --git a/discoreg/discoreg/settings.py b/discoreg/discoreg/settings.py index da8121c..5db8ec5 100644 --- a/discoreg/discoreg/settings.py +++ b/discoreg/discoreg/settings.py @@ -26,8 +26,6 @@ DEBUG = os.environ.get("DEBUG", False) == "1" ALLOWED_HOSTS = [ - "pygotham-chat-staging.herokuapp.com", - "pygotham-chat-production.herokuapp.com", "chat.pygotham.tv", "tylerdave.ngrok.io", "localhost", diff --git a/discoreg/registrations/templates/registrations/index.html b/discoreg/registrations/templates/registrations/index.html index e4ba034..4740145 100644 --- a/discoreg/registrations/templates/registrations/index.html +++ b/discoreg/registrations/templates/registrations/index.html @@ -11,7 +11,7 @@

Join PyGotham TV on Discord!

1. Register for PyGotham TV

To be added to our Discord server you need to register for the conference using the same email address as your Discord account.

Already registered? Skip to step 2.

-

Register for PyGotham TV

+

Register for PyGotham TV

2. Log in to Discord

diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e9b55d9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,21 @@ +version: '3' + +services: + web: + image: discoreg + build: + context: ./discoreg + dockerfile: Dockerfile + container_name: discoreg + ports: + - '8000:8000' + env_file: + - example.env + worker: + image: nextupbot + build: + context: ./discoreg + dockerfile: Dockerfile.nextupbot + container_name: nextupbot + env_file: + - example.env diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh new file mode 100644 index 0000000..bfcc0d1 --- /dev/null +++ b/docker-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Collect static files +echo "Collect static files" +python3 discoreg/manage.py collectstatic --noinput + +# Apply database migrations +echo "Apply database migrations" +python3 discoreg/manage.py migrate + +# Start server +echo "Starting server" +gunicorn --pythonpath discoreg discoreg.wsgi --bind 0.0.0.0:8000 --log-file - diff --git a/example.env b/example.env index 57ff9b6..77630c6 100644 --- a/example.env +++ b/example.env @@ -1,3 +1,4 @@ +DJANGO_SECRET_KEY="foo" DISCORD_CLIENT_ID="REPLACE WITH CLIENT_ID" DISCORD_CLIENT_SECRET="REPLACE WITH CLIENT_SECRET" DISCORD_BOT_TOKEN="REPLACE WITH BOT_TOKEN" diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..99618f9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,34 @@ +aiohttp==3.6.2 +asgiref==3.2.10 +async-timeout==3.0.1 +attrs==19.3.0 +bleach==3.1.5 +blinker==1.4 +certifi==2020.6.20 +chardet==3.0.4 +discord-py==1.3.4 +dj-database-url==0.5.0 +django==3.0.8 +django-heroku==0.3.1 +gunicorn==20.0.4 +idna==2.10 +importlib-metadata==1.7.0 +jsonpickle==1.4.1 +multidict==4.7.6 +oauthlib==3.1.0 +packaging==20.4 +psycopg2==2.8.5 +pyparsing==2.4.7 +pytz==2020.1 +pyyaml==5.3.1 +raygun4py==4.3.0 +requests==2.24.0 +requests-oauthlib==1.3.0 +six==1.15.0 +sqlparse==0.3.1 +urllib3==1.25.10 +webencodings==0.5.1 +websockets==8.1 +whitenoise==5.1.0 +yarl==1.4.2 +zipp==3.1.0 From 42588dbf31a996de50f71b1c24cfd73865d48fed Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 25 Sep 2023 14:32:34 -0400 Subject: [PATCH 2/7] set docker-entrypoint as executable --- docker-entrypoint.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 docker-entrypoint.sh diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh old mode 100644 new mode 100755 From e1cab649e737356a80c7f9ed5f536f76e1793bd3 Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 25 Sep 2023 14:34:50 -0400 Subject: [PATCH 3/7] Removing Procfile --- Procfile | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 Procfile diff --git a/Procfile b/Procfile deleted file mode 100644 index 9f94334..0000000 --- a/Procfile +++ /dev/null @@ -1,3 +0,0 @@ -release: python discoreg/manage.py migrate -web: gunicorn --pythonpath discoreg discoreg.wsgi --log-file - -worker: python discoreg/manage.py nextupbot From a12a6a3cd591b2fe0c21c7b9b6b78c0001d44c20 Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 25 Sep 2023 23:51:58 -0400 Subject: [PATCH 4/7] use port 80 instead --- Dockerfile | 2 +- Dockerfile.nextupbot | 2 +- docker-compose.yml | 2 +- docker-entrypoint.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 944fc2d..be73e7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.8 ENV PYTHONUNBUFFERED 1 WORKDIR /discoreg -EXPOSE 8000 +EXPOSE 80 COPY requirements.txt /discoreg RUN pip3 install -r requirements.txt --no-cache-dir diff --git a/Dockerfile.nextupbot b/Dockerfile.nextupbot index 0da1661..5cc8c23 100644 --- a/Dockerfile.nextupbot +++ b/Dockerfile.nextupbot @@ -3,7 +3,7 @@ FROM python:3.8 ENV PYTHONUNBUFFERED 1 WORKDIR /discoreg -EXPOSE 8000 +EXPOSE 80 COPY requirements.txt /discoreg RUN pip3 install -r requirements.txt --no-cache-dir diff --git a/docker-compose.yml b/docker-compose.yml index e9b55d9..08bb903 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: dockerfile: Dockerfile container_name: discoreg ports: - - '8000:8000' + - '80:80' env_file: - example.env worker: diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index bfcc0d1..25fc3de 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,4 +10,4 @@ python3 discoreg/manage.py migrate # Start server echo "Starting server" -gunicorn --pythonpath discoreg discoreg.wsgi --bind 0.0.0.0:8000 --log-file - +gunicorn --pythonpath discoreg discoreg.wsgi --bind 0.0.0.0:80 --log-file - From e3d2e994a014165cbddc2781b04829a684886a72 Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 2 Oct 2023 21:09:55 -0400 Subject: [PATCH 5/7] Server will be running on port 8000, using pip-compile --- Dockerfile | 2 +- docker-entrypoint.sh | 2 +- requirements.in | 34 +++++++++ requirements.txt | 171 +++++++++++++++++++++++++++++++++++-------- 4 files changed, 175 insertions(+), 34 deletions(-) create mode 100644 requirements.in diff --git a/Dockerfile b/Dockerfile index be73e7b..944fc2d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ FROM python:3.8 ENV PYTHONUNBUFFERED 1 WORKDIR /discoreg -EXPOSE 80 +EXPOSE 8000 COPY requirements.txt /discoreg RUN pip3 install -r requirements.txt --no-cache-dir diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 25fc3de..efe2012 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -10,4 +10,4 @@ python3 discoreg/manage.py migrate # Start server echo "Starting server" -gunicorn --pythonpath discoreg discoreg.wsgi --bind 0.0.0.0:80 --log-file - +gunicorn --pythonpath discoreg discoreg.wsgi --log-file - diff --git a/requirements.in b/requirements.in new file mode 100644 index 0000000..cea3a75 --- /dev/null +++ b/requirements.in @@ -0,0 +1,34 @@ +aiohttp +asgiref +async-timeout +attrs +bleach +blinker +certifi +chardet +discord-py +dj-database-url +django +django-heroku +gunicorn +idna +importlib-metadata +jsonpickle +multidict +oauthlib +packaging +psycopg2 +pyparsing +pytz +pyyaml +raygun4py +requests +requests-oauthlib +six +sqlparse +urllib3 +webencodings +websockets +whitenoise +yarl +zipp diff --git a/requirements.txt b/requirements.txt index 99618f9..bafbb3b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,34 +1,141 @@ -aiohttp==3.6.2 -asgiref==3.2.10 -async-timeout==3.0.1 -attrs==19.3.0 -bleach==3.1.5 -blinker==1.4 -certifi==2020.6.20 -chardet==3.0.4 -discord-py==1.3.4 -dj-database-url==0.5.0 -django==3.0.8 +# +# This file is autogenerated by pip-compile with Python 3.8 +# by the following command: +# +# pip-compile requirements.in +# +--extra-index-url https://pypi.python.org/simple/ +--trusted-host pypi.python.org + +aiohttp==3.8.5 + # via + # -r requirements.in + # discord-py +aiosignal==1.3.1 + # via aiohttp +asgiref==3.7.2 + # via + # -r requirements.in + # django +async-timeout==4.0.3 + # via + # -r requirements.in + # aiohttp +attrs==23.1.0 + # via + # -r requirements.in + # aiohttp +backports-zoneinfo==0.2.1 + # via django +bleach==6.0.0 + # via -r requirements.in +blinker==1.6.2 + # via + # -r requirements.in + # raygun4py +certifi==2023.7.22 + # via + # -r requirements.in + # requests +chardet==5.2.0 + # via -r requirements.in +charset-normalizer==3.3.0 + # via + # aiohttp + # requests +discord-py==2.3.2 + # via -r requirements.in +dj-database-url==2.1.0 + # via + # -r requirements.in + # django-heroku +django==4.2.5 + # via + # -r requirements.in + # dj-database-url + # django-heroku django-heroku==0.3.1 -gunicorn==20.0.4 -idna==2.10 -importlib-metadata==1.7.0 -jsonpickle==1.4.1 -multidict==4.7.6 -oauthlib==3.1.0 -packaging==20.4 -psycopg2==2.8.5 -pyparsing==2.4.7 -pytz==2020.1 -pyyaml==5.3.1 -raygun4py==4.3.0 -requests==2.24.0 -requests-oauthlib==1.3.0 -six==1.15.0 -sqlparse==0.3.1 -urllib3==1.25.10 + # via -r requirements.in +frozenlist==1.4.0 + # via + # aiohttp + # aiosignal +gunicorn==21.2.0 + # via -r requirements.in +idna==3.4 + # via + # -r requirements.in + # requests + # yarl +importlib-metadata==6.8.0 + # via -r requirements.in +jsonpickle==3.0.2 + # via + # -r requirements.in + # raygun4py +multidict==6.0.4 + # via + # -r requirements.in + # aiohttp + # yarl +oauthlib==3.2.2 + # via + # -r requirements.in + # requests-oauthlib +packaging==23.2 + # via + # -r requirements.in + # gunicorn +psycopg2==2.9.8 + # via + # -r requirements.in + # django-heroku +pyparsing==3.1.1 + # via -r requirements.in +pytz==2023.3.post1 + # via -r requirements.in +pyyaml==6.0.1 + # via -r requirements.in +raygun4py==4.4.0 + # via -r requirements.in +requests==2.31.0 + # via + # -r requirements.in + # raygun4py + # requests-oauthlib +requests-oauthlib==1.3.1 + # via -r requirements.in +six==1.16.0 + # via + # -r requirements.in + # bleach +sqlparse==0.4.4 + # via + # -r requirements.in + # django +typing-extensions==4.8.0 + # via + # asgiref + # dj-database-url +urllib3==2.0.6 + # via + # -r requirements.in + # requests webencodings==0.5.1 -websockets==8.1 -whitenoise==5.1.0 -yarl==1.4.2 -zipp==3.1.0 + # via + # -r requirements.in + # bleach +websockets==11.0.3 + # via -r requirements.in +whitenoise==6.5.0 + # via + # -r requirements.in + # django-heroku +yarl==1.9.2 + # via + # -r requirements.in + # aiohttp +zipp==3.17.0 + # via + # -r requirements.in + # importlib-metadata From f1a621de11d528d344cafe8d5a054450b2707b11 Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 2 Oct 2023 21:27:35 -0400 Subject: [PATCH 6/7] switch all docker ports to 8000 --- Dockerfile.nextupbot | 1 - docker-compose.yml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Dockerfile.nextupbot b/Dockerfile.nextupbot index 5cc8c23..21d1a07 100644 --- a/Dockerfile.nextupbot +++ b/Dockerfile.nextupbot @@ -3,7 +3,6 @@ FROM python:3.8 ENV PYTHONUNBUFFERED 1 WORKDIR /discoreg -EXPOSE 80 COPY requirements.txt /discoreg RUN pip3 install -r requirements.txt --no-cache-dir diff --git a/docker-compose.yml b/docker-compose.yml index 08bb903..e9b55d9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: dockerfile: Dockerfile container_name: discoreg ports: - - '80:80' + - '8000:8000' env_file: - example.env worker: From 17adbec6bbd8733a2f65c6576103ec55984eb39b Mon Sep 17 00:00:00 2001 From: Joe Cabrera Date: Mon, 2 Oct 2023 21:55:58 -0400 Subject: [PATCH 7/7] adding dj_database_url for portability --- discoreg/discoreg/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discoreg/discoreg/settings.py b/discoreg/discoreg/settings.py index 5db8ec5..ef97591 100644 --- a/discoreg/discoreg/settings.py +++ b/discoreg/discoreg/settings.py @@ -10,6 +10,7 @@ https://docs.djangoproject.com/en/3.0/ref/settings/ """ +import dj_database_url import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) @@ -91,10 +92,9 @@ # https://docs.djangoproject.com/en/3.0/ref/settings/#databases DATABASES = { - "default": { - "ENGINE": "django.db.backends.sqlite3", - "NAME": os.path.join(BASE_DIR, "db.sqlite3"), - } + "default": dj_database_url.config( + default="sqlite:///{}".format(os.path.join(BASE_DIR, 'db.sqlite3')), + ), }