Skip to content

Commit 4d1b6e3

Browse files
committed
Initial commit
0 parents  commit 4d1b6e3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1315
-0
lines changed

.dockerignore

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#> Custom dockerignore file for Docker and Django
2+
3+
# Docker environment
4+
.env
5+
6+
# Git
7+
.git/
8+
.github/
9+
.gitignore
10+
CODE_OF_CONDUCT.md
11+
CONTRIBUTING.md
12+
PULL_REQUEST_TEMPLATE.md
13+
14+
# Visual Studio Code
15+
.vscode
16+
17+
# Django environments
18+
linux-venv/
19+
windows-venv/
20+
21+
# Pycache
22+
__pycache__/
23+
*.pyc
24+
25+
# SQLite
26+
*.sqlite3
27+
28+
#> Custom dockerignore file for esite
29+
30+
# Audios
31+
*.ogg
32+
*.mp3
33+
34+
# Images
35+
*.jpg
36+
*.png
37+
*.gif
38+
*.svg
39+
40+
# Fonts
41+
*.ttf
42+
43+
# SPDX-License-Identifier: (EUPL-1.2)
44+
# Copyright © 2019 Werbeagentur Christian Aichner

.github/ISSUE_TEMPLATE/bug_report.md

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Browser [e.g. chrome, safari]
29+
- Version [e.g. 22]
30+
31+
**Smartphone (please complete the following information):**
32+
- Device: [e.g. iPhone6]
33+
- OS: [e.g. iOS8.1]
34+
- Browser [e.g. stock browser, safari]
35+
- Version [e.g. 22]
36+
37+
**Additional context**
38+
Add any other context about the problem here.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Additional context**
17+
Add any other context or screenshots about the feature request here.
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Trimmed Feature request
3+
about: Suggest a quick idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the feature or change you'd like**
11+
A clear and concise description of what you want to happen.
12+
13+
**Additional context**
14+
Add any other context or screenshots about the feature request here.

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#> Custom gitignore file for Docker and Django
2+
# Docker environment
3+
.env
4+
5+
# Django environments
6+
linux-venv/
7+
windows-venv/
8+
9+
# Pycache
10+
__pycache__/
11+
*.pyc
12+
13+
# SQLite
14+
*.sqlite3
15+
16+
#> Custom gitignore file for esite
17+
# Audios
18+
*.ogg
19+
*.mp3
20+
21+
# Images
22+
*.jpg
23+
*.png
24+
*.gif
25+
*.svg
26+
27+
# Fonts
28+
*.ttf
29+
30+
# SPDX-License-Identifier: (EUPL-1.2)
31+
# Copyright © 2019 Werbeagentur Christian Aichner

.vscode/extensions.json

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"recommendations": [
3+
"coenraads.bracket-pair-colorizer-2",
4+
"streetsidesoftware.code-spell-checker",
5+
"msjsdiag.debugger-for-chrome",
6+
"dracula-theme.theme-dracula",
7+
"flowtype.flow-for-vscode",
8+
"walter-ribeiro.full-react-snippets",
9+
"bradgashler.htmltagwrap",
10+
"yzhang.markdown-all-in-one",
11+
"christian-kohler.npm-intellisense",
12+
"christian-kohler.path-intellisense",
13+
"esbenp.prettier-vscode",
14+
"pmneo.tsimporter",
15+
"eg2.vscode-npm-script",
16+
"formulahendry.auto-rename-tag",
17+
"oderwat.indent-rainbow"
18+
]
19+
}

.vscode/settings.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"python.pythonPath": "windows-venv\\Scripts\\python.exe"
3+
"editor.rulers": [80,120]
4+
"editor.fontFamily": "Fira Code, Consolas, 'Courier New', monospace",
5+
"editor.fontLigatures": true,
6+
"editor.snippetSuggestions": "top",
7+
"terminal.integrated.fontFamily": "Consolas",
8+
"workbench.colorTheme": "Dracula Soft",
9+
"cSpell.ignoreWords": [
10+
"aichner",
11+
"eupl",
12+
"mdbreact",
13+
"spdx",
14+
"werbeagentur",
15+
"fontawesome",
16+
"fortawesome",
17+
"reactjs",
18+
"react.js"
19+
],
20+
"cSpell.enabledLanguageIds": [
21+
"html",
22+
"go",
23+
"javascript",
24+
"javascriptreact",
25+
"markdown",
26+
"php",
27+
"plaintext",
28+
"text",
29+
"typescript",
30+
"typescriptreact",
31+
"yml"
32+
],
33+
"cSpell.showStatus": true,
34+
"cSpell.ignorePaths": [
35+
"node_modules"
36+
],
37+
"cSpell.words": [
38+
"browserslist",
39+
"homescreen",
40+
"precached",
41+
"renamer",
42+
"webfonts"
43+
]
44+
}

CODE_OF_CONDUCT.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
Code of Conflict
2+
----------------
3+
4+
Our development effort is a very personal process compared
5+
to "traditional" ways of developing software. Your code and ideas
6+
behind it will be carefully reviewed, often resulting in critique and
7+
criticism. The review will almost always require improvements to the
8+
code before it can be included. Know that this happens
9+
because everyone involved wants to see the best possible solution for
10+
the overall success of this project.
11+
12+
As a reviewer of code, please strive to keep things civil and focused on
13+
the technical issues involved. We are all humans, and frustrations can
14+
be high on both sides of the process. Try to keep in mind the immortal
15+
words of Bill and Ted, "Be excellent to each other."

CONTRIBUTING.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Contributing
2+
3+
When contributing to this repository, please first discuss the change you wish to make via issue,
4+
email, or any other method with the owners of this repository before making a change.
5+
6+
Please follow these coding standards when writing code for inclusion in this repository.
7+
https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
8+
9+
Note we have a code of conduct (code of conflict), please follow it in all your interactions with the project.

COPYING

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
The Linux Kernel is provided under:
2+
3+
SPDX-License-Identifier: EUPL-1.2
4+
5+
Being under the terms of the European Union Public Licence version 1.2 only,
6+
according with:
7+
8+
LICENSES/preferred/EUPL-1.2

Dockerfile

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
FROM python:3.7-alpine
2+
3+
LABEL description="This container serves as an entry point for our future Django projects."
4+
5+
# Developed for Werbeagentur Christian Aichner by Florian Kleber
6+
# for terms of use have a look at the LICENSE file.
7+
MAINTAINER Florian Kleber <[email protected]>
8+
9+
# Add custom environment variables needed by Django or your settings file here:
10+
ENV DJANGO_DEBUG=on \
11+
DJANGO_SETTINGS_MODULE=esite.settings.production
12+
13+
# The uWSGI configuration (customize as needed):
14+
ENV UWSGI_VIRTUALENV=/venv \
15+
UWSGI_UID=1000 \
16+
UWSGI_GID=2000 \
17+
UWSGI_WSGI_FILE=esite/wsgi_production.py \
18+
UWSGI_HTTP=:8000 \
19+
UWSGI_MASTER=1 \
20+
UWSGI_WORKERS=2 \
21+
UWSGI_THREADS=1
22+
23+
WORKDIR /code/
24+
25+
# Add pre-installation requirements:
26+
ADD requirements/ /requirements/
27+
28+
# Update, install and cleaning:
29+
RUN echo "## Installing base ##" && \
30+
echo "@main http://dl-cdn.alpinelinux.org/alpine/edge/main/" >> /etc/apk/repositories && \
31+
echo "@testing http://dl-cdn.alpinelinux.org/alpine/edge/testing/" >> /etc/apk/repositories && \
32+
echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community/" >> /etc/apk/repositories && \
33+
apk upgrade --update-cache --available && \
34+
\
35+
apk add --no-cache --virtual .build-deps \
36+
gcc \
37+
g++ \
38+
make \
39+
libc-dev \
40+
musl-dev \
41+
linux-headers \
42+
pcre-dev \
43+
postgresql-dev \
44+
libjpeg-turbo-dev \
45+
zlib-dev \
46+
expat-dev \
47+
;\
48+
apk add --force \
49+
git@main \
50+
bash@main \
51+
libjpeg-turbo@main \
52+
pcre@main \
53+
postgresql-client@main \
54+
tini@community \
55+
\
56+
&& python -m venv /venv \
57+
&& /venv/bin/pip install -U pip \
58+
&& LIBRARY_PATH=/lib:/usr/lib /bin/sh -c "/venv/bin/pip install -r /requirements/production.txt" \
59+
&& runDeps="$( \
60+
scanelf --needed --nobanner --recursive /venv \
61+
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
62+
| sort -u \
63+
| xargs -r apk info --installed \
64+
| sort -u \
65+
)" \
66+
&& apk add --virtual .python-rundeps $runDeps \
67+
&& apk del .build-deps \
68+
&& rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*
69+
70+
EXPOSE 8000
71+
72+
VOLUME /code/media
73+
74+
ADD . /code/
75+
76+
# Place init, make it executable and
77+
# make sure venv files can be used by uWSGI process:
78+
RUN mv /code/docker-entrypoint.sh / ;\
79+
chmod +x /docker-entrypoint.sh ;\
80+
find /venv/ -type f -iname "*.py" -exec chmod -v +x {} ;\
81+
\
82+
# Call collectstatic with dummy environment variables:
83+
DATABASE_URL=postgres://none REDIS_URL=none /venv/bin/python manage.py collectstatic --noinput
84+
85+
# I personally like to start my containers with tini
86+
# which start uWSGI, using a wrapper script to allow us to easily add
87+
# more commands to container startup:
88+
ENTRYPOINT ["/sbin/tini", "--", "/docker-entrypoint.sh"]
89+
90+
CMD ["/venv/bin/uwsgi", "--http-auto-chunked", \
91+
"--http-keepalive", \
92+
"--static-map", \
93+
"/media/=/code/media/"\
94+
]
95+
96+
# SPDX-License-Identifier: (EUPL-1.2)
97+
# Copyright © 2019 Werbeagentur Christian Aichner

0 commit comments

Comments
 (0)