From fbf79ea848a2ed205c1af58c9d4a19dea774588e Mon Sep 17 00:00:00 2001 From: Mykola Date: Tue, 9 May 2023 20:09:18 +0300 Subject: [PATCH] fix: docker build --- .dockerignore | 3 --- Dockerfile | 15 +++++++++++++++ yarn.lock | 6 +++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.dockerignore b/.dockerignore index bf725ec..1019aa0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -15,8 +15,5 @@ README.md TODO.md **/.venv /tests/ -/src/ **/*.sqlite3 -**/package.json **/tox.ini -**/yarn.lock diff --git a/Dockerfile b/Dockerfile index 8bbfbe4..b2d342e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,17 @@ +########################################## +## build frontend +########################################## +FROM node:buster as front_build +# FROM node as front_build +RUN mkdir /front +WORKDIR /front +COPY . /front/ +RUN yarn +RUN npx update-browserslist-db@latest -y +RUN yarn css +RUN yarn js + + FROM python:3.11-alpine # install build utils and dependencies @@ -36,3 +50,4 @@ RUN poetry install --no-dev --no-interaction --no-ansi RUN poetry add gunicorn COPY --chown=app:app . . +COPY --chown=app:app --from=front_build /front/app/static ./app/static diff --git a/yarn.lock b/yarn.lock index 576496b..67cfbed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1566,9 +1566,9 @@ camelcase-css@^2.0.1: integrity sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA== caniuse-lite@^1.0.30001449, caniuse-lite@^1.0.30001464: - version "1.0.30001480" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz#9bbd35ee44c2480a1e3a3b9f4496f5066817164a" - integrity sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ== + version "1.0.30001486" + resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz" + integrity sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg== chalk@^2.0.0: version "2.4.2"