diff --git a/custom/Dockerfile b/custom/Dockerfile index b89508129..28ae99065 100644 --- a/custom/Dockerfile +++ b/custom/Dockerfile @@ -33,8 +33,8 @@ RUN cd /tmp && PIP_NO_BINARY=fiona,rasterio,shapely PROJ_DIR=/usr/local/ pipenv RUN apt-get remove --autoremove --assume-yes gcc WORKDIR /app -COPY . /app -RUN python3 -m pip install --disable-pip-version-check --no-cache-dir --editable=/app/ && \ +COPY . ./ +RUN python3 -m pip install --disable-pip-version-check --no-cache-dir --editable=. && \ python3 -m compileall -q /app/custom # hadolint ignore=DL3059 RUN mkdir -p /etc/gunicorn/ && \ diff --git a/custom/README.txt b/custom/README.txt deleted file mode 100644 index 5b37c6b4c..000000000 --- a/custom/README.txt +++ /dev/null @@ -1,44 +0,0 @@ -custom -====== - -Getting Started ---------------- - -- Change directory into your newly created project if not already there. Your - current directory should be the same as this README.txt file and setup.py. - - cd custom - -- Create a Python virtual environment, if not already created. - - python3 -m venv env - -- Upgrade packaging tools, if necessary. - - env/bin/pip install --upgrade pip setuptools - -- Install the project in editable mode with its testing requirements. - - env/bin/pip install -e ".[testing]" - -- Initialize and upgrade the database using Alembic. - - - Generate your first revision. - - env/bin/alembic -c development.ini revision --autogenerate -m "init" - - - Upgrade to that revision. - - env/bin/alembic -c development.ini upgrade head - -- Load default data into the database using a script. - - env/bin/initialize_custom_db development.ini - -- Run your project's tests. - - env/bin/pytest - -- Run your project. - - env/bin/pserve development.ini diff --git a/custom/custom/models/__init__.py b/custom/custom/models/__init__.py index 612da2d9d..a8ca97a8f 100644 --- a/custom/custom/models/__init__.py +++ b/custom/custom/models/__init__.py @@ -1,11 +1,7 @@ -import os - import zope.sqlalchemy -from sqlalchemy import Column, Integer, String, engine_from_config +from sqlalchemy import engine_from_config from sqlalchemy.orm import configure_mappers, sessionmaker -from .meta import Base - # Run ``configure_mappers`` after defining all of the models to ensure # all relationships can be setup. configure_mappers() @@ -120,13 +116,3 @@ def dbsession(request): return dbsession config.add_request_method(dbsession, reify=True) - - -class Feedback(Base): - __tablename__ = "feedback" - __table_args__ = {"schema": os.environ.get("PGSCHEMA", "main")} - id_feedback = Column(Integer, primary_key=True) - ua = Column(String(250)) - permalink = Column(String(5000)) - text = Column(String(1000)) - email = Column(String(100)) diff --git a/custom/custom/models/feedback.py b/custom/custom/models/feedback.py new file mode 100644 index 000000000..bf2484aeb --- /dev/null +++ b/custom/custom/models/feedback.py @@ -0,0 +1,14 @@ +import os + +from sqlalchemy import Column, Integer, String + +from .meta import Base + +class Feedback(Base): + __tablename__ = "feedback" + __table_args__ = {"schema": os.environ.get("PGSCHEMA", "main")} + id_feedback = Column(Integer, primary_key=True) + ua = Column(String(250)) + permalink = Column(String(5000)) + text = Column(String(1000)) + email = Column(String(100)) diff --git a/docker-compose-lib.yaml b/docker-compose-lib.yaml index 2f7dc4ce5..d7385626a 100644 --- a/docker-compose-lib.yaml +++ b/docker-compose-lib.yaml @@ -193,13 +193,6 @@ services: geoportal: image: ${DOCKER_BASE}-geoportal:${DOCKER_TAG} - build: - context: geoportal - args: - GIT_HASH: ${GIT_HASH} - PGSCHEMA: ${PGSCHEMA} - GEOMAPFISH_VERSION: ${GEOMAPFISH_VERSION} - GEOMAPFISH_MAIN_VERSION: ${GEOMAPFISH_MAIN_VERSION} user: www-data restart: unless-stopped environment: