commit 9117b11b286aea0c4718fcd751187dff85f91c54 Author: Sebastian Hugentobler Date: Mon Apr 15 15:00:23 2024 +0200 initial commit diff --git a/.gitea/workflows/container.yaml b/.gitea/workflows/container.yaml new file mode 100644 index 0000000..e48b3fd --- /dev/null +++ b/.gitea/workflows/container.yaml @@ -0,0 +1,12 @@ +name: Build Multiarch Container Image +on: [push] +jobs: + call-reusable-workflow: + uses: container/multiarch-build-workflow/.gitea/workflows/build.yaml@main + with: + repository: ${{ gitea.repository }} + ref_name: ${{ gitea.ref_name }} + sha: ${{ gitea.sha }} + registry_url: ${{ secrets.REGISTRY_URL }} + registry_user: ${{ secrets.REGISTRY_USER }} + registry_pw: ${{ secrets.REGISTRY_PW }} diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..af0faab --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +.DS_Store +*.swp diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..1fc875b --- /dev/null +++ b/Containerfile @@ -0,0 +1,98 @@ +FROM docker.io/alpine:3.19 AS builder + +ENV POETRY_VIRTUALENVS_IN_PROJECT=true +ENV POETRY_NO_INTERACTION=1 +ENV PYTHONUNBUFFERED=1 +ENV PYTHONDONTWRITEBYTECODE=1 +ENV PIP_NO_CACHE_DIR=off + +RUN apk --no-cache add \ + yarn \ + poetry \ + git \ + musl-dev \ + gcc \ + g++ \ + make \ + python3-dev \ + openldap-dev \ + zlib-dev \ + jpeg-dev \ + grep \ + sed + +ENV VERSION=v1.4.0 + +RUN git clone https://github.com/mealie-recipes/mealie.git +WORKDIR /mealie +RUN git checkout $VERSION +RUN poetry install -E pgsql --only main +RUN find .venv/bin -type f -exec grep -lZ "^#!/mealie/.venv/bin/python" {} + | xargs -0 -I {} sed -i "1s|^#!/mealie/.venv/bin/python|#!/py-pkgs/bin/python|" {} +RUN echo "/home/mealie/app/" > /mealie/.venv/lib/python3.11/site-packages/mealie.pth + +WORKDIR /mealie/frontend +RUN yarn install \ + --prefer-offline \ + --frozen-lockfile \ + --non-interactive \ + --production=false \ + --network-timeout 1000000 \ + --ignore-engines +RUN echo "n" | yarn generate + +FROM docker.io/alpine:3.19 as crfpp + +ENV VERSION=c56dd9f29469c8a9f34456b8c0d6ae0476110516 + +RUN apk --no-cache add \ + g++ \ + make \ + git + +RUN git clone https://github.com/mealie-recipes/crfpp.git +WORKDIR /crfpp +RUN git checkout $VERSION + +RUN ./configure --prefix=/ +RUN make +RUN make DESTDIR=/dist install + +FROM docker.io/alpine:3.19 + +ENV PRODUCTION=true +ENV TESTING=false +ENV PYTHONPATH=/py-pkgs +ENV PATH=$PATH:/py-pkgs/bin +ENV STATIC_FILES=/home/mealie/app/static + +RUN addgroup -g 2222 mealie +RUN adduser -h /home/mealie -u 2222 -D -G mealie mealie + +RUN apk add --no-cache \ + python3 \ + libldap \ + zlib \ + jpeg \ + py3-gunicorn + +COPY --from=crfpp /dist/bin /bin/ +COPY --from=crfpp /dist/lib /lib/ +COPY --from=builder --chown=mealie:mealie /mealie/.venv /py-pkgs +COPY --from=builder --chown=mealie:mealie /mealie/mealie /home/mealie/app/mealie +COPY --from=builder --chown=mealie:mealie /mealie/gunicorn_conf.py /home/mealie/app/gunicorn_conf.py +COPY --from=builder --chown=mealie:mealie /mealie/alembic.ini /home/mealie/app/alembic.ini +COPY --from=builder --chown=mealie:mealie /mealie/alembic /home/mealie/app/alembic +COPY --from=builder --chown=mealie:mealie /mealie/frontend/dist /home/mealie/app/static + +RUN mkdir -p /app/data +RUN chown mealie:mealie /app/data + +ENV HOME /home/mealie/app +WORKDIR /home/mealie/app +USER mealie + +RUN /py-pkgs/bin/python /home/mealie/app/mealie/scripts/install_model.py + +EXPOSE 9000 +VOLUME ["/app/data"] +CMD ["uvicorn", "mealie.app:app", "--host", "0.0.0.0", "--port", "9000"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..05aacf1 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ +[Mealie](https://mealie.io/) server. + +# Environment Variables + +See the +[mealie documentation](https://docs.mealie.io/documentation/getting-started/installation/backend-config) +to see configuration variables and their defaults. + +# Ports + +- 9000