Skip to content

Commit

Permalink
Made project run without virtualenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrey Rusakov committed Aug 14, 2024
1 parent 43a4394 commit e42e0b5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 36 deletions.
24 changes: 13 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
FROM ubuntu:oracular AS builder
FROM python:3.12.5-slim-bookworm
LABEL Maintainer="[email protected]" Vendor="Camptocamp"

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
POETRY_HOME='/usr/local'

WORKDIR /app/geoshop_back/
COPY . /app/geoshop_back/

RUN apt update && \
apt upgrade -y && \
apt install -y bash postgresql curl \
python3 python3-poetry python3-setuptools gunicorn \
libgdal-dev libffi-dev && \
cd /app/geoshop_back/ && \
poetry update && \
poetry install --no-root
COPY poetry.lock pyproject.toml /app/geoshop_back/

RUN apt update && apt install -y libgdal-dev libffi-dev && \
pip install poetry && \
poetry install --only=main

COPY . /app/geoshop_back/
2 changes: 1 addition & 1 deletion api/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

UserModel = get_user_model()

class CustomModelAdmin(admin.ModelAdmin):
class CustomModelAdmin(admin.GISModelAdmin):
"""
This is just a cosmetic class adding custom CSS and Replacing CharField Widget by
a TextField widget when Charfields are longer than 300 characters.
Expand Down
10 changes: 5 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ services:
environment:
PGHOST: "db"
command: >
poetry run python3 manage.py migrate &&
poetry run python3 manage.py collectstatic --noinput &&
poetry run python3 manage.py compilemessages --locale=fr &&
poetry run python3 manage.py fixturize
python3 manage.py migrate &&
python3 manage.py collectstatic --noinput &&
python3 manage.py compilemessages --locale=fr &&
python3 manage.py fixturize
volumes:
- "static-files:/app/geoshop_back/static:rw"
networks:
Expand All @@ -59,7 +59,7 @@ services:
env_file: .env
environment:
PGHOST: "db"
command: "poetry run gunicorn wsgi -b :8000 --timeout 90"
command: gunicorn wsgi -b :8000 --timeout 90
restart: unless-stopped
volumes:
- "static-files:/app/geoshop_back/static:ro"
Expand Down
18 changes: 3 additions & 15 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jsonschema = "^4.23.0"
jsonschema-specifications = "^2023.12.1"
Markdown = "^3.6"
oauthlib = "^3.2.2"
psycopg2 = "^2.9.9"
psycopg2-binary = "^2.9.9"
pycparser = "^2.22"
PyJWT = "^2.9.0"
py-moneyed = "^3.0"
Expand All @@ -43,16 +43,14 @@ referencing = "^0.35.1"
requests = "^2.32.3"
requests-oauthlib = "^2.0.0"
rpds-py = "^0.20.0"
setuptools = "^72.1.0"
sqlparse = "^0.5.1"
typing-extensions = "^4.12.2"
Unidecode = "^1.3.8"
uritemplate = "^4.1.1"
urllib3 = "^2.2.2"
whitenoise = "^6.7.0"
Django = "^5.1"
GDAL = "3.4.1"

[build-system]
requires = ["poetry-core>=1.0.0"]
requires = ["poetry-core>=1.6.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit e42e0b5

Please sign in to comment.