-
-
Notifications
You must be signed in to change notification settings - Fork 704
Expand file tree
/
Copy pathDockerfile.server.j2
More file actions
53 lines (42 loc) · 1.16 KB
/
Dockerfile.server.j2
File metadata and controls
53 lines (42 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{% 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"]