diff --git a/.dockerignore b/.dockerignore index 514a217417..b9920eb4ff 100644 --- a/.dockerignore +++ b/.dockerignore @@ -10,6 +10,7 @@ LICENSE .env .env.template .github +.git .idea .prettierignore LICENSE.md diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index a544b7f9f2..8f3ff0d825 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -34,18 +34,10 @@ jobs: echo VERSION=develop >> $GITHUB_OUTPUT fi - # Build Vue 3 frontend - - uses: actions/setup-node@v4 - with: - node-version: '22' - cache: yarn - cache-dependency-path: vue3/yarn.lock - - name: Install dependencies - working-directory: ./vue3 - run: yarn install --frozen-lockfile - - name: Build dependencies - working-directory: ./vue3 - run: yarn build + - name: Setup python + uses: actions/setup-python@v6 + - name: Generate version.py + run: python version.py - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/Dockerfile b/Dockerfile index 07c078921b..b23c85569d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,34 +1,87 @@ +# Build frontend +FROM node:22-alpine AS build +COPY --link ./vue3 /opt/recipes/vue3 +WORKDIR /opt/recipes/vue3 +RUN yarn install --frozen-lockfile && \ + yarn build + +# Main app image FROM python:3.13-alpine3.22 -#Install all dependencies. -RUN apk add --no-cache postgresql-libs postgresql-client gettext zlib libjpeg libwebp libxml2-dev libxslt-dev openldap git libgcc libstdc++ nginx tini envsubst nodejs npm +# Install all dependencies. +RUN apk add --no-cache \ + envsubst \ + gettext \ + libgcc \ + libjpeg \ + libstdc++ \ + libwebp \ + libxml2-dev \ + libxslt-dev \ + nginx \ + nodejs \ + npm \ + openldap \ + postgresql-client \ + postgresql-libs \ + tini \ + zlib #Print all logs without buffering it. ENV PYTHONUNBUFFERED=1 \ DOCKER=true -#This port will be used by gunicorn. +# This port will be used by gunicorn. EXPOSE 80 8080 -#Create app dir and install requirements. -RUN mkdir /opt/recipes +# Create app dir and install requirements. WORKDIR /opt/recipes -COPY requirements.txt ./ - -# remove Development dependencies from requirements.txt -RUN sed -i '/# Development/,$d' requirements.txt -RUN apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev zlib-dev jpeg-dev libwebp-dev openssl-dev libffi-dev cargo openldap-dev python3-dev xmlsec-dev xmlsec build-base g++ curl rust && \ - python -m venv venv && \ - /opt/recipes/venv/bin/python -m pip install --upgrade pip && \ - venv/bin/pip debug -v && \ - venv/bin/pip install wheel==0.45.1 && \ - venv/bin/pip install setuptools_rust==1.10.2 && \ - venv/bin/pip install -r requirements.txt --no-cache-dir &&\ +COPY --link requirements.txt ./ + +RUN <