forked from curly60e/pyblock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
64 lines (50 loc) Β· 1.83 KB
/
Copy pathdockerfile
File metadata and controls
64 lines (50 loc) Β· 1.83 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
54
55
56
57
58
59
60
61
62
63
64
FROM ubuntu:24.04
WORKDIR /app
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV PYBLOCK_PORT=6969
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential cmake git libjson-c-dev libwebsockets-dev \
python3 python3-pip python3-venv \
curl jq wget \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Pin ttyd to a specific release tag for reproducibility
RUN git clone --branch 1.7.7 --depth 1 https://github.com/tsl0922/ttyd.git \
&& cd ttyd \
&& mkdir build \
&& cd build \
&& cmake .. \
&& make \
&& make install \
&& cd /app && rm -rf ttyd
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-dev libgmp-dev libffi-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN python3 -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
# Copy project files
COPY requirements.txt /app/pyblock/requirements.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /app/pyblock/requirements.txt
COPY . /app/pyblock/
# Entrypoint for auto-configuration
COPY entrypoint.sh /app/entrypoint.sh
RUN chmod +x /app/entrypoint.sh
# Create config volume mount point
RUN mkdir -p /app/pyblock/pybitblock/config
# Pin pyblock to UID/GID 1000 so it matches the user Umbrel forces via
# `user: "1000:1000"` in docker-compose. The base ubuntu:24.04 image ships an
# `ubuntu` user already at 1000, so remove it first to free the UID.
RUN userdel -r ubuntu 2>/dev/null || true \
&& groupadd -g 1000 pyblock \
&& useradd -m -s /bin/bash -u 1000 -g 1000 pyblock \
&& chown -R pyblock:pyblock /app
USER pyblock
EXPOSE 6969
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:${PYBLOCK_PORT:-6969}/ || exit 1
ENTRYPOINT ["/app/entrypoint.sh"]