Skip to content

Commit

Permalink
fix: Add multiple labels in backend, import and export (#101)
Browse files Browse the repository at this point in the history
- Add multiple labels (to support branch and taxonomy labelling) in parser
- Add multiple labels in unparser and tests
- Changed API endpoints accordingly to support different branches and taxonomies
- Wrapped entries.py in a class for easier use
- Added import functionality
- Added export functionality

fixes: 
- #69 
relates to:
- #71 
- #83
  • Loading branch information
aadarsh-ram authored Nov 7, 2022
1 parent 63dbf17 commit a40b9fd
Show file tree
Hide file tree
Showing 19 changed files with 1,144 additions and 532 deletions.
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# use windows path separator for compat
COMPOSE_PATH_SEPARATOR=;
COMPOSE_FILE=docker-compose.yml;docker/dev.yml

DOCKER_TAG=dev

# domain name
TAXONOMY_EDITOR_DOMAIN=taxonomy.localhost
# exposition
Expand Down
11 changes: 8 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,17 @@ RUN groupadd -g $USER_GID off && \
mkdir -p /home/off && \
chown off:off -R /code /home/off

COPY ./requirements.txt /code/requirements.txt
COPY backend/requirements.txt /code/requirements.txt
COPY backend/editor /code/editor
COPY parser /parser

RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
# this is purely cosmetic
RUN ln -s /parser/openfoodfacts_taxonomy_parser /code/openfoodfacts_taxonomy_parser
RUN --mount=type=cache,id=pip-cache,target=/root/.cache/pip \
pip3 install --upgrade -r /code/requirements.txt

USER off:off
COPY --chown=off:off ./editor /code/editor
COPY --chown=off:off ./backend/editor /code/editor

CMD ["uvicorn", "editor.api:app", "--host", "0.0.0.0", "--port", "80"]
CMD ["uvicorn", "editor.api:app", "--host", "0.0.0.0", "--port", "80"]
Loading

0 comments on commit a40b9fd

Please sign in to comment.