aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.dockerignore7
-rw-r--r--.gitignore2
-rw-r--r--Pipfile3
-rw-r--r--Pipfile.lock150
-rw-r--r--docker/app/Dockerfile20
-rw-r--r--docker/app/build-wiki.Dockerfile2
-rw-r--r--docker/app/local.Dockerfile21
-rw-r--r--docker/app/scripts/build-wiki.sh4
-rw-r--r--docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whlbin0 -> 1287002 bytes
9 files changed, 153 insertions, 56 deletions
diff --git a/.dockerignore b/.dockerignore
index f2475d80..771913a3 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -11,21 +11,16 @@
.venv
__pycache__
pydis_site/apps/admin/tests
-pydis_site/apps/admin/tests.py
pydis_site/apps/api/tests
-pydis_site/apps/api/tests.py
pydis_site/apps/home/tests
-pydis_site/apps/home/tests.py
pydis_site/apps/staff/tests
-pydis_site/apps/staff/tests.py
CHANGELOG.md
CONTRIBUTING.md
docker
-!docker/app/scripts/migrate_and_boot.sh
!docker/app/scripts/migrate.sh
!docker/app/uwsgi.ini
+!docker/app/wheels
docker-compose.yml
-Dockerfile
Dockerfile.local
docs
htmlcov
diff --git a/.gitignore b/.gitignore
index 2888775d..24bdf199 100644
--- a/.gitignore
+++ b/.gitignore
@@ -117,5 +117,7 @@ media/
pip-wheel-metadata/
staticfiles/
+!docker/app/wheels
+
*.js.tmp
log.*
diff --git a/Pipfile b/Pipfile
index 6da62a2b..43b26d86 100644
--- a/Pipfile
+++ b/Pipfile
@@ -31,7 +31,8 @@ django-crispy-bulma = ">=0.1.2,<2.0"
whitenoise = "==4.1.2"
requests = "~=2.21"
pygments = "~=2.3.1"
-wiki = {git = "https://github.com/python-discord/django-wiki.git"}
+#wiki = {git = "https://github.com/python-discord/django-wiki.git"}
+wiki = {path = "./docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl"}
pyyaml = "*"
[requires]
diff --git a/Pipfile.lock b/Pipfile.lock
index c77efb32..36059664 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
{
"_meta": {
"hash": {
- "sha256": "6db9cd90e14c74c0f9ae0d714df163ad4e8fcd2795a3c333b296b467f2ce2d09"
+ "sha256": "d44e1d6fdeba2a0fdda4a249ebcb4a2f8062cc4b2ba1ef2c8de017bc442571fa"
},
"pipfile-spec": 6,
"requires": {
@@ -16,12 +16,19 @@
]
},
"default": {
+ "bleach": {
+ "hashes": [
+ "sha256:0ee95f6167129859c5dce9b1ca291ebdb5d8cd7e382ca0e237dfd0dad63f63d8",
+ "sha256:24754b9a7d530bf30ce7cbc805bc6cce785660b4a10ff3a43633728438c105ab"
+ ],
+ "version": "==2.1.4"
+ },
"certifi": {
"hashes": [
- "sha256:046832c04d4e752f37383b628bc601a7ea7211496b4638f6514d0e5b9acc4939",
- "sha256:945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695"
+ "sha256:e4f3620cfea4f83eedc95b24abd9cd56f3c4b146dd0177e83a21b4eb49e21e50",
+ "sha256:fd7c7c74727ddcf00e9acd26bba8da604ffec95bf1c2144e67aff7a8b50e6cef"
],
- "version": "==2019.6.16"
+ "version": "==2019.9.11"
},
"chardet": {
"hashes": [
@@ -38,6 +45,12 @@
"index": "pypi",
"version": "==2.2.5"
},
+ "django-classy-tags": {
+ "hashes": [
+ "sha256:38b4546a8053499e2fef7af679a58d7c868298717d645b8b8227acba5fd4bf2b"
+ ],
+ "version": "==0.9.0"
+ },
"django-crispy-bulma": {
"hashes": [
"sha256:0d982e217a95706e0bbecd9f43990c191b071a20287478c7847ff096567e6e64",
@@ -78,6 +91,33 @@
"index": "pypi",
"version": "==3.0"
},
+ "django-js-asset": {
+ "hashes": [
+ "sha256:8ec12017f26eec524cab436c64ae73033368a372970af4cf42d9354fcb166bdd",
+ "sha256:c163ae80d2e0b22d8fb598047cd0dcef31f81830e127cfecae278ad574167260"
+ ],
+ "version": "==1.2.2"
+ },
+ "django-mptt": {
+ "hashes": [
+ "sha256:18a41d1b56ca7c02a5b04d246e33ee2d18f6ee5459c02ed1d945f5abdef23a2e",
+ "sha256:689a04cce0981671d6061a9928c33a16b47abb0d4cd43cf7dec31ae284fdae9d"
+ ],
+ "version": "==0.9.1"
+ },
+ "django-nyt": {
+ "hashes": [
+ "sha256:187f2aae5088c4cf79e7a7caa55c2a9c292722f50cf185c5a738636713ae67ea",
+ "sha256:5556e2de47a7b710325a33c49314ee3eff7021d638492e957ef2de15c9360143"
+ ],
+ "version": "==1.1.3"
+ },
+ "django-sekizai": {
+ "hashes": [
+ "sha256:642a3356fe92fe9b5ccc97f320b64edd2cfcb3b2fbb113e8a26dad9a1f3b5e14"
+ ],
+ "version": "==1.0.0"
+ },
"django-simple-bulma": {
"hashes": [
"sha256:ca2e4dbda5cf2d697cef91701a9fd7e58cecec93a76897158c4d7e135aa13842",
@@ -101,6 +141,13 @@
"index": "pypi",
"version": "==0.2.1"
},
+ "html5lib": {
+ "hashes": [
+ "sha256:20b159aa3badc9d5ee8f5c647e5efd02ed2a66ab8d354930bd9ff139fc1dc0a3",
+ "sha256:66cb0dcfdbbc4f9c3ba1a63fdb511ffdbd4f513b2b6d81b80cd26ce6b3fb3736"
+ ],
+ "version": "==1.0.1"
+ },
"idna": {
"hashes": [
"sha256:c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407",
@@ -128,6 +175,44 @@
],
"version": "==0.19.2"
},
+ "markdown": {
+ "hashes": [
+ "sha256:c00429bd503a47ec88d5e30a751e147dcb4c6889663cd3e2ba0afe858e009baa",
+ "sha256:d02e0f9b04c500cde6637c11ad7c72671f359b87b9fe924b2383649d8841db7c"
+ ],
+ "version": "==3.0.1"
+ },
+ "pillow": {
+ "hashes": [
+ "sha256:0804f77cb1e9b6dbd37601cee11283bba39a8d44b9ddb053400c58e0c0d7d9de",
+ "sha256:0ab7c5b5d04691bcbd570658667dd1e21ca311c62dcfd315ad2255b1cd37f64f",
+ "sha256:0b3e6cf3ea1f8cecd625f1420b931c83ce74f00c29a0ff1ce4385f99900ac7c4",
+ "sha256:365c06a45712cd723ec16fa4ceb32ce46ad201eb7bbf6d3c16b063c72b61a3ed",
+ "sha256:38301fbc0af865baa4752ddae1bb3cbb24b3d8f221bf2850aad96b243306fa03",
+ "sha256:3aef1af1a91798536bbab35d70d35750bd2884f0832c88aeb2499aa2d1ed4992",
+ "sha256:3fe0ab49537d9330c9bba7f16a5f8b02da615b5c809cdf7124f356a0f182eccd",
+ "sha256:45a619d5c1915957449264c81c008934452e3fd3604e36809212300b2a4dab68",
+ "sha256:49f90f147883a0c3778fd29d3eb169d56416f25758d0f66775db9184debc8010",
+ "sha256:571b5a758baf1cb6a04233fb23d6cf1ca60b31f9f641b1700bfaab1194020555",
+ "sha256:5ac381e8b1259925287ccc5a87d9cf6322a2dc88ae28a97fe3e196385288413f",
+ "sha256:6153db744a743c0c8c91b8e3b9d40e0b13a5d31dbf8a12748c6d9bfd3ddc01ad",
+ "sha256:6fd63afd14a16f5d6b408f623cc2142917a1f92855f0df997e09a49f0341be8a",
+ "sha256:70acbcaba2a638923c2d337e0edea210505708d7859b87c2bd81e8f9902ae826",
+ "sha256:70b1594d56ed32d56ed21a7fbb2a5c6fd7446cdb7b21e749c9791eac3a64d9e4",
+ "sha256:76638865c83b1bb33bcac2a61ce4d13c17dba2204969dedb9ab60ef62bede686",
+ "sha256:7b2ec162c87fc496aa568258ac88631a2ce0acfe681a9af40842fc55deaedc99",
+ "sha256:7cee2cef07c8d76894ebefc54e4bb707dfc7f258ad155bd61d87f6cd487a70ff",
+ "sha256:7d16d4498f8b374fc625c4037742fbdd7f9ac383fd50b06f4df00c81ef60e829",
+ "sha256:b50bc1780681b127e28f0075dfb81d6135c3a293e0c1d0211133c75e2179b6c0",
+ "sha256:bd0582f831ad5bcad6ca001deba4568573a4675437db17c4031939156ff339fa",
+ "sha256:cfd40d8a4b59f7567620410f966bb1f32dc555b2b19f82a91b147fac296f645c",
+ "sha256:e3ae410089de680e8f84c68b755b42bc42c0ceb8c03dbea88a5099747091d38e",
+ "sha256:e9046e559c299b395b39ac7dbf16005308821c2f24a63cae2ab173bd6aa11616",
+ "sha256:ef6be704ae2bc8ad0ebc5cb850ee9139493b0fc4e81abcc240fb392a63ebc808",
+ "sha256:f8dc19d92896558f9c4317ee365729ead9d7bbcf2052a9a19a3ef17abbb8ac5b"
+ ],
+ "version": "==6.1.0"
+ },
"psycopg2-binary": {
"hashes": [
"sha256:080c72714784989474f97be9ab0ddf7b2ad2984527e77f2909fcd04d4df53809",
@@ -211,6 +296,13 @@
],
"version": "==1.12.0"
},
+ "sorl-thumbnail": {
+ "hashes": [
+ "sha256:8dfe5fda91a5047d1d35a0b9effe7b000764a01d648e15ca076f44e9c34b6dbd",
+ "sha256:d9e3f018d19293824803e4ffead96b19dfcd44fa7987cea392f50436817bef34"
+ ],
+ "version": "==12.5.0"
+ },
"sqlparse": {
"hashes": [
"sha256:40afe6b8d4b1117e7dff5504d7a8ce07d9a1b15aeeade8a2d10f130a834f8177",
@@ -220,10 +312,17 @@
},
"urllib3": {
"hashes": [
- "sha256:b246607a25ac80bedac05c6f282e3cdaf3afb65420fd024ac94435cabe6e18d1",
- "sha256:dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"
+ "sha256:2f3eadfea5d92bc7899e75b5968410b749a054b492d5a6379c1344a1481bc2cb",
+ "sha256:9c6c593cb28f52075016307fc26b0a0f8e82bc7d1ff19aaaa959b91710a56c47"
],
- "version": "==1.25.3"
+ "version": "==1.25.5"
+ },
+ "webencodings": {
+ "hashes": [
+ "sha256:a0af1213f3c2226497a97e2b3aa01a7e4bee4f403f95be16fc9acd2947514a78",
+ "sha256:b36a1c245f2d304965eb4e0a82848379241dc04b865afcc4aab16748587e1923"
+ ],
+ "version": "==0.5.1"
},
"whitenoise": {
"hashes": [
@@ -234,8 +333,11 @@
"version": "==4.1.2"
},
"wiki": {
- "git": "https://github.com/python-discord/django-wiki.git",
- "ref": "66d443248279fb8decf23f68c5363ecf6362ee09"
+ "hashes": [
+ "sha256:73a53bc770ce6b1d2ea6916d81ccefe40751d87b30556fa3b992c85b7fde8534"
+ ],
+ "path": "./docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl",
+ "version": "==0.5.dev20190420204942"
}
},
"develop": {
@@ -267,14 +369,6 @@
],
"version": "==2.0.1"
},
- "colorama": {
- "hashes": [
- "sha256:05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d",
- "sha256:f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"
- ],
- "markers": "platform_system == 'Windows'",
- "version": "==0.4.1"
- },
"coverage": {
"hashes": [
"sha256:08907593569fe59baca0bf152c43f3863201efb6113ecb38ce7e97ce339805a6",
@@ -406,10 +500,10 @@
},
"importlib-metadata": {
"hashes": [
- "sha256:9ff1b1c5a354142de080b8a4e9803e5d0d59283c93aed808617c787d16768375",
- "sha256:b7143592e374e50584564794fcb8aaf00a23025f9db866627f89a21491847a8d"
+ "sha256:aa18d7378b00b40847790e7c27e11673d7fed219354109d0e7b9e5b25dc3ad26",
+ "sha256:d5f18a79777f3aa179c145737780282e27b508fc8fd688cb17c7a813e8bd39af"
],
- "version": "==0.20"
+ "version": "==0.23"
},
"mccabe": {
"hashes": [
@@ -434,10 +528,10 @@
},
"pbr": {
"hashes": [
- "sha256:56e52299170b9492513c64be44736d27a512fa7e606f21942160b68ce510b4bc",
- "sha256:9b321c204a88d8ab5082699469f52cc94c5da45c51f114113d01b3d993c24cdf"
+ "sha256:2c8e420cd4ed4cec4e7999ee47409e876af575d4c35a45840d59e8b5f3155ab8",
+ "sha256:b32c8ccaac7b1a20c0ce00ce317642e6cf231cf038f9875e0280e28af5bf7ac9"
],
- "version": "==5.4.2"
+ "version": "==5.4.3"
},
"pep8-naming": {
"hashes": [
@@ -511,16 +605,16 @@
},
"snowballstemmer": {
"hashes": [
- "sha256:9f3b9ffe0809d174f7047e121431acf99c89a7040f0ca84f94ba53a498e6d0c9"
+ "sha256:713e53b79cbcf97bc5245a06080a33d54a77e7cce2f789c835a143bcdb5c033e"
],
- "version": "==1.9.0"
+ "version": "==1.9.1"
},
"stevedore": {
"hashes": [
- "sha256:7be098ff53d87f23d798a7ce7ae5c31f094f3deb92ba18059b1aeb1ca9fec0a0",
- "sha256:7d1ce610a87d26f53c087da61f06f9b7f7e552efad2a7f6d2322632b5f932ea2"
+ "sha256:01d9f4beecf0fbd070ddb18e5efb10567801ba7ef3ddab0074f54e3cd4e91730",
+ "sha256:e0739f9739a681c7a1fda76a102b65295e96a144ccdb552f2ae03c5f0abe8a14"
],
- "version": "==1.30.1"
+ "version": "==1.31.0"
},
"toml": {
"hashes": [
diff --git a/docker/app/Dockerfile b/docker/app/Dockerfile
index 67b3ef69..a6986fb2 100644
--- a/docker/app/Dockerfile
+++ b/docker/app/Dockerfile
@@ -1,29 +1,27 @@
-FROM bitnami/python:3.7-prod
+FROM python:3.7-slim
-# I have no idea what this does.
+# Allow service to handle stops gracefully
STOPSIGNAL SIGQUIT
+# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_NOSPIN=1
-# Create a user.
+# Create non-root user.
RUN useradd --system --shell /bin/false --uid 1500 pysite
-# Install prerequisites needed to complete the dependency installation.
-RUN install_packages git gcc libc-dev libpq-dev
+# Install pipenv & pyuwsgi
+RUN pip install -U pipenv pyuwsgi
-# Copy the project files into the working directory.
+# Copy the project files into working directory
WORKDIR /app
COPY . .
-# Update setuptools by removing egg first, add other dependencies
-RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
- pip install -U setuptools
-RUN pip install pipenv uwsgi
+# Install project dependencies
RUN pipenv install --system --deploy
-# Migrate, collect and start the app.
+# Migrate, collect and start the app
RUN chmod +x /app/docker/app/scripts/migrate.sh
ENTRYPOINT ["/app/docker/app/scripts/migrate.sh"]
CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/build-wiki.Dockerfile b/docker/app/build-wiki.Dockerfile
new file mode 100644
index 00000000..92003377
--- /dev/null
+++ b/docker/app/build-wiki.Dockerfile
@@ -0,0 +1,2 @@
+FROM python:3.7
+RUN pip --no-cache-dir wheel --wheel-dir=/wheels "wiki @ git+https://github.com/python-discord/django-wiki.git"
diff --git a/docker/app/local.Dockerfile b/docker/app/local.Dockerfile
index 2c95cea3..9e15c438 100644
--- a/docker/app/local.Dockerfile
+++ b/docker/app/local.Dockerfile
@@ -1,27 +1,28 @@
-FROM bitnami/python:3.7-prod
+FROM python:3.7-slim
+# Allow service to handle stops gracefully
STOPSIGNAL SIGQUIT
+# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
PIPENV_HIDE_EMOJIS=1 \
PIPENV_NOSPIN=1
-# Create a user.
+# Create non-root user
RUN useradd --system --shell /bin/false --uid 1500 pysite
-# Install prerequisites needed to complete the dependency installation.
-RUN install_packages git gcc libc-dev libpq-dev
+# Install pipenv & pyuwsgi
+RUN pip install -U pipenv pyuwsgi
-# Copy the project files into the working directory.
+# Copy the project files into working directory
WORKDIR /app
COPY . .
-# Update setuptools by removing egg first, add other dependencies
-RUN rm -r /opt/bitnami/python/lib/python3.*/site-packages/setuptools* && \
- pip install -U setuptools
-RUN pip install pipenv uwsgi
+# Install project dependencies
RUN pipenv install --system --deploy
-RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// python3 manage.py collectstatic --no-input --clear --verbosity 0
+# Prepare static files for site
+RUN SECRET_KEY=placeholder DATABASE_URL=sqlite:// \
+ python3 manage.py collectstatic --no-input --clear --verbosity 0
CMD ["uwsgi", "--ini", "docker/app/uwsgi.ini"]
diff --git a/docker/app/scripts/build-wiki.sh b/docker/app/scripts/build-wiki.sh
new file mode 100644
index 00000000..07c54f66
--- /dev/null
+++ b/docker/app/scripts/build-wiki.sh
@@ -0,0 +1,4 @@
+docker build -t build_uwsgi -f docker/app/build-wiki.Dockerfile .
+CONTAINER=$(docker run -itd build_uwsgi /bin/bash)
+docker cp "$CONTAINER:/wheels" docker/app
+docker stop "$CONTAINER"
diff --git a/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl b/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl
new file mode 100644
index 00000000..b7637e76
--- /dev/null
+++ b/docker/app/wheels/wiki-0.5.dev20190420204942-py3-none-any.whl
Binary files differ