diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 22609cdf..931dc9b6 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -14,15 +14,20 @@ on: - created env: + DOCKER_BUILDKIT: 1 IMAGE_NAME: fuji jobs: - + build-and-publish: # Build and push image to GitHub Container Registry https://docs.docker.com/docker-hub/builds/ - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: + + - run: docker --version + - run: docker buildx version + - uses: actions/checkout@v3 - name: Build image diff --git a/Dockerfile b/Dockerfile index 3b68ed4b..ebc5ca80 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,11 @@ -FROM python:3 +# syntax=docker/dockerfile:1.5 +FROM python:3.8-slim + +WORKDIR /usr/src/app + +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + ### python:3 image: No java available: Cannot run TIKA... ### Install Java via the package manager RUN apt-get update \ @@ -10,13 +17,9 @@ RUN apt-get update \ ## OR: Use Ubuntu image with python and java pre-installed instead (smallest): #FROM korekontrol/ubuntu-java-python3:latest -RUN mkdir -p /usr/src/app -WORKDIR /usr/src/app - -COPY pyproject.toml ./ -COPY /fuji_server ./fuji_server - -RUN pip3 install --no-cache-dir . +COPY README.md pyproject.toml ./ +COPY fuji_server ./fuji_server +RUN pip install --no-cache-dir . # Docker doesn't like 'localhost' RUN sed -i "s|localhost|0.0.0.0 |g" ./fuji_server/config/server.ini diff --git a/pyproject.toml b/pyproject.toml index 8e1eee95..c301ca5a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,9 +29,9 @@ dependencies = [ "idutils~=1.1.5", "jmespath~=0.10.0", "levenshtein~=0.12.0", - "lxml~=4.7.1", + "lxml~=4.7", "markupsafe~=2.0.1", - "pandas~=1.3.5", + "pandas~=1.3", "pyRdfa3~=3.5.3", "pyld~=2.0.3", "pyyaml!=6.0.0,!=5.4.0,!=5.4.1", @@ -46,8 +46,7 @@ dependencies = [ "werkzeug~=1.0" ] description = "FUJI (FAIRsFAIR Data Objects Assessment Service), A service to evaluate FAIR data objects based on FAIRsFAIR Metrics" -# TODO: figure out why the README causes failure of building the docker container -# readme = "README.md" +readme = "README.md" keywords = [ "PANGAEA", "FAIRsFAIR",