mirror of
https://github.com/Screenly/Anthias.git
synced 2026-04-21 06:58:02 -04:00
Add back WORKDIR /usr/src/app in server, celery, and websocket Dockerfiles that was lost during the uv migration. Without it, containers crash on startup because CMD runs from / instead of /usr/src/app. Also apply ruff formatting to utils.py and add a wait step in the OpenAPI schema CI workflow. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
1.2 KiB
Django/Jinja
54 lines
1.2 KiB
Django/Jinja
{% if environment == 'production' %}
|
|
FROM debian:bookworm AS node-builder
|
|
|
|
{% include 'nodejs-install.j2' %}
|
|
|
|
RUN mkdir -p /app
|
|
WORKDIR /app
|
|
|
|
COPY package.json \
|
|
package-lock.json \
|
|
webpack.prod.js \
|
|
webpack.common.js \
|
|
tsconfig.json \
|
|
/app/
|
|
RUN npm install
|
|
|
|
COPY ./static/sass/*.scss /app/static/sass/
|
|
COPY ./static/src/ /app/static/src/
|
|
RUN npm run build
|
|
|
|
{% endif %}
|
|
{% include 'Dockerfile.base.j2' %}
|
|
|
|
COPY pyproject.toml uv.lock /tmp/uv-deps/
|
|
{% if disable_cache_mounts %}
|
|
RUN \
|
|
{% else %}
|
|
RUN --mount=type=cache,target=/root/.cache/uv \
|
|
{% endif %}
|
|
uv venv --system-site-packages /opt/venv && \
|
|
cd /tmp/uv-deps && \
|
|
VIRTUAL_ENV=/opt/venv uv sync --active --only-group server --no-install-project --frozen
|
|
|
|
ENV PATH="/opt/venv/bin:$PATH"
|
|
|
|
RUN mkdir -p /usr/src/app
|
|
COPY . /usr/src/app/
|
|
WORKDIR /usr/src/app
|
|
|
|
{% if environment == 'production' %}
|
|
COPY --from=node-builder \
|
|
/app/static/dist/ \
|
|
/usr/src/app/static/dist/
|
|
{% else %}
|
|
{% include 'nodejs-install.j2' %}
|
|
{% endif %}
|
|
|
|
ENV GIT_HASH={{ git_hash }}
|
|
ENV GIT_SHORT_HASH={{ git_short_hash }}
|
|
ENV GIT_BRANCH={{ git_branch }}
|
|
ENV DEVICE_TYPE={{ board }}
|
|
|
|
CMD ["bash", "bin/start_server.sh"]
|