Skip to content

Commit

Permalink
Update application
Browse files Browse the repository at this point in the history
  • Loading branch information
manti-by committed Jul 23, 2024
1 parent 8c376a8 commit 8e14fb3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fail_fast: true
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-docstring-first
Expand All @@ -15,7 +15,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py312-plus]
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
FROM python:3.12-slim

# Add directories
RUN mkdir -p /srv/semkov/src/ && \
mkdir -p /var/lib/semkov/static/ && \
mkdir -p /var/lib/semkov/media/ && \
mkdir -p /var/lib/semkov/data/ && \
mkdir -p /var/log/semkov/
RUN mkdir -p /srv/app/src/ && \
mkdir -p /var/lib/app/static/ && \
mkdir -p /var/lib/app/media/ && \
mkdir -p /var/lib/app/data/ && \
mkdir -p /var/log/app/

# Install any needed packages specified in requirements
COPY requirements.txt /tmp/requirements.txt
RUN pip install --trusted-host pypi.org --no-cache-dir -r /tmp/requirements.txt

# Add manti system user
RUN useradd -m -s /bin/bash -d /home/manti manti && \
chown -R manti:manti /srv/semkov/src/ /var/lib/semkov/ /var/log/semkov/
chown -R manti:manti /srv/app/src/ /var/lib/app/ /var/log/app/

# Select user, set working directory and run server
USER manti
WORKDIR /srv/semkov/src/
CMD python manage.py runserver
WORKDIR /srv/app/src/
CMD ["python", "manage.py", "runserver"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ update-data:
./manage.py update_transport
./manage.py update_positions

update-requirements:
update:
pcu requirements.txt -u
pre-commit autoupdate

Expand Down
13 changes: 6 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
version: '3.3'
services:

semkov-postgres:
Expand All @@ -19,13 +18,13 @@ services:
links:
- semkov-postgres
volumes:
- /home/manti/www/semkov/:/srv/semkov/src/
- /mnt/data/www/semkov/static/:/var/lib/semkov/static/
- /mnt/data/www/semkov/media/:/var/lib/semkov/media/
- /mnt/data/www/semkov/data/:/var/lib/semkov/data/
- /mnt/data/www/semkov/log/:/var/log/semkov/
- /home/manti/www/semkov/:/srv/app/src/
- /mnt/data/www/semkov/static/:/var/lib/app/static/
- /mnt/data/www/semkov/media/:/var/lib/app/media/
- /mnt/data/www/semkov/data/:/var/lib/app/data/
- /mnt/data/www/semkov/log/:/var/log/app/
environment:
- DJANGO_SETTINGS_MODULE=semkov.settings.prod
- POSTGRES_HOST=semkov-postgres
command: |
gunicorn semkov.wsgi:application --bind 0.0.0.0:8898 --workers 2 --log-file /var/log/semkov/wsgi.log
gunicorn semkov.wsgi:application --bind 0.0.0.0:8898 --workers 2 --log-file /var/log/app/wsgi.log
22 changes: 11 additions & 11 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
wagtail==6.0.2
pillow==10.3.0
gunicorn==21.2.0
wagtail==6.1.3
pillow==10.4.0
gunicorn==22.0.0
psycopg2_binary==2.9.9
requests==2.31.0
requests==2.32.3

pytest>=8.1.1
pytest>=8.3.1
pytest-django>=4.8.0

ipython>=8.23.0
pre_commit>=3.7.0
pip-check-updates>=0.26.1
ipython>=8.26.0
pre_commit>=3.7.1
pip-check-updates>=0.27.0

isort>=5.13.2
bandit>=1.7.8
black>=24.3.0
bandit>=1.7.9
black>=24.4.2
prospector>=1.10.3
pyupgrade>=3.15.2
pyupgrade>=3.16.0
2 changes: 1 addition & 1 deletion semkov/apps/core/management/commands/update_transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Command(BaseCommand):

bus_type = 3
arrival_stop_ids = ("25948176", "114793481")
departure_stop_ids = ("25699328",)
departure_stop_ids = ("60014592",)

def get_routes(self, stop_ids: tuple) -> list[dict] | None:
result = []
Expand Down

0 comments on commit 8e14fb3

Please sign in to comment.