1# syntax=docker/dockerfile:1
2
3FROM python:3.12-slim-bookworm
4
5# needed for native module build (won't be needed if/when I get wheels in pypi)
6RUN apt update && apt install -y gcc git
7
8# create low-priv user (no need to mess with groups since we won't use UNIX domain sockets)
9RUN adduser --system --shell /bin/false --home /opt/millipds millipds
10WORKDIR /opt/millipds
11
12# copy in the src and drop its privs
13COPY . src/
14RUN chown -R millipds src/
15
16# install, under the low-priv user
17USER millipds
18RUN python3 -m pip install -v src/
19
20# init the db with dev presets
21RUN python3 -m millipds init millipds.test --dev
22
23# create a test user
24RUN python3 -m millipds account create bob.test did:web:bob.test --unsafe_password=hunter2
25
26# do the thing
27CMD python3 -m millipds run --listen_host=0.0.0.0 --listen_port=8123
28
29EXPOSE 8123/tcp