-
Notifications
You must be signed in to change notification settings - Fork 4
Feedback docker #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
4-dash
wants to merge
33
commits into
master
Choose a base branch
from
feedback_docker
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feedback docker #349
Changes from 11 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
3b08ed7
remove binary files, wsgi rename
4-dash 1e6477b
add Dockerfile
4-dash 427b09b
add docker compose and .env
4-dash 26ac563
update Dockerfile
4-dash f040805
dockerfile fix
4-dash 61495e8
bug fix
4-dash 0a2c05e
minor change
4-dash c706cfe
minor fix
4-dash 33fcaf3
rename env
4-dash c6eb85f
minor changes
4-dash e87233c
improve dockerfile
4-dash 02d4335
Merge branch 'master' into feedback_docker
4-dash 17d6e5d
seperate node stage, etc
4-dash f2692a9
fix logger
4-dash 40cb86a
cleaner setting management
4-dash 27e9fe1
add toml file, update readme
4-dash 6547817
remove requirements.txt
4-dash c1de861
move coverage settings to toml
4-dash c246135
fix
4-dash abedbfa
fix debugtoolbar urls etc
4-dash a796681
fix
4-dash e31d4c6
coverage fix
4-dash bef3d84
try to increase coverage
4-dash c7ae134
fixes and more tests
4-dash e238a0e
fix
4-dash 51a78e1
more tests and improve templatetag
4-dash c073cd4
add comment
4-dash f9146b2
update readme badge
4-dash bc13765
fix
4-dash 42c779c
Update Readme.md
4-dash 7e36e29
build action
4-dash 004cd36
fix
4-dash db666bf
badge
4-dash File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| latex/anschreiben/veranstalter.adr | ||
| # Ignore all files in db folder | ||
| db/* | ||
| # But keep the folder | ||
| !db/.gitkeep | ||
|
|
||
| *.pyc | ||
| htmlcov | ||
| pyenv | ||
| *.aux | ||
| *.log | ||
| .idea | ||
| *.adr | ||
| .project | ||
| .pydevproject | ||
| .settings/* | ||
| .coverage | ||
| settings_secret.py | ||
| static/* | ||
| venv/ | ||
| .venv | ||
| .vscode/* | ||
| .python-version | ||
|
|
||
| node_modules/ | ||
|
|
||
| *.mo | ||
|
|
||
| .env |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| SETTINGS_FILE=settings | ||
| DEBUG=False | ||
| ALLOWED_HOSTS=.fachschaft.informatik.tu-darmstadt.de,.d120.de | ||
| SECRET_KEY= | ||
| KEYCLOAK_CLIENT_ID= | ||
| KEYCLOAK_SECRET= | ||
| KEYCLOAK_SERVER_URL= | ||
| EMAIL_HOST= | ||
| EMAIL_PORT= | ||
| EMAIL_HOST_USER= | ||
| EMAIL_HOST_PASSWORD= | ||
| GUNICORN_WORKERS= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,12 @@ pyenv | |
| settings_secret.py | ||
| static/* | ||
| venv/ | ||
| .venv/ | ||
| .vscode/* | ||
| .python-version | ||
|
|
||
| node_modules/ | ||
|
|
||
| *.mo | ||
|
|
||
| .env | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| ## Stage 1: build stage | ||
| FROM python:3.13-slim AS builder | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ENV PYTHONDONTWRITEBYTECODE=1 | ||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # install packages and node | ||
| RUN apt-get update && apt-get install -y \ | ||
| curl \ | ||
| gnupg \ | ||
| ca-certificates \ | ||
| && curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ | ||
| && apt-get install -y nodejs \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| # install pip requirements | ||
| COPY requirements.txt . | ||
| RUN pip install --upgrade pip && \ | ||
| pip install --no-cache-dir -r requirements.txt | ||
|
|
||
| # install node_modules | ||
| COPY package*.json ./ | ||
| RUN npm i | ||
|
|
||
| ## Stage 2: production stage | ||
| FROM python:3.13-slim | ||
|
|
||
| ARG DEBIAN_FRONTEND=noninteractive | ||
| ENV PYTHONDONTWRITEBYTECODE=1 | ||
| ENV PYTHONUNBUFFERED=1 | ||
|
|
||
| RUN useradd -m -r appuser && \ | ||
| mkdir /app && \ | ||
| chown -R appuser /app | ||
|
|
||
| # Copy dependencies from builder | ||
| COPY --from=builder /usr/local/lib/python3.13/site-packages/ /usr/local/lib/python3.13/site-packages/ | ||
| COPY --from=builder /usr/local/bin/ /usr/local/bin/ | ||
| COPY --from=builder /app/node_modules/ /app/node_modules/ | ||
|
|
||
| # install gettext for translations | ||
| RUN apt-get update && apt-get install -y gettext \ | ||
| && apt-get clean \ | ||
| && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # copy the code | ||
| COPY --chown=appuser:appuser . . | ||
|
|
||
| WORKDIR /app/src | ||
|
|
||
| USER appuser | ||
|
|
||
| # compile translations | ||
| RUN django-admin compilemessages | ||
|
|
||
| # --- Runtime Setup --- | ||
| USER root | ||
| COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
| RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
|
||
| USER appuser | ||
|
|
||
| ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
|
|
||
| EXPOSE 8000 | ||
|
|
||
| # start applicaiton with gunicorn | ||
| CMD ["sh", "-c", "gunicorn --bind 0.0.0.0:8000 --workers ${GUNICORN_WORKERS:-3} wsgi:application"] | ||
|
4-dash marked this conversation as resolved.
Outdated
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| services: | ||
| pyfeedback: | ||
| build: . | ||
| container_name: pyfeedback-docker | ||
| ports: | ||
| - "8000:8000" | ||
| env_file: | ||
| - .env | ||
| volumes: | ||
| - pyfeedback-db:/app/db/ | ||
|
|
||
| volumes: | ||
| pyfeedback-db: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| #!/bin/sh | ||
|
|
||
| # Exit on error | ||
| set -e | ||
|
|
||
| echo "Applying database migrations..." | ||
| python manage.py migrate --no-input | ||
|
|
||
| # Start the application | ||
| echo "Starting Gunicorn..." | ||
| exec "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| import os | ||
|
|
||
| from django.core.wsgi import get_wsgi_application | ||
|
|
||
| # select in .env which settings to use | ||
| settings_file = os.getenv("SETTINGS_FILE", "settings") | ||
|
|
||
| os.environ.setdefault("DJANGO_SETTINGS_MODULE", settings_file) | ||
|
|
||
| application = get_wsgi_application() |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.