forked from allenporter/supernote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 975 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 975 Bytes
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
FROM python:3.14-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
SUPERNOTE_STORAGE_DIR=/data \
SUPERNOTE_CONFIG_DIR=/data/config \
SUPERNOTE_HOST=0.0.0.0 \
SUPERNOTE_PORT=8000
# Create a non-root user
RUN groupadd -g 1000 -r supernote && useradd -u 1000 -r -g supernote supernote
# Install system dependencies for SQL Lite CLI
RUN apt-get update && \
apt-get install -y --no-install-recommends sqlite3 && \
rm -rf /var/lib/apt/lists/*
# Set working directory and copy project files
WORKDIR /app
COPY pyproject.toml README.md LICENSE ./
COPY supernote/ supernote/
# Install the package with server dependencies
RUN pip install --no-cache-dir ".[server]"
# Create directories for storage and config, and set permissions
RUN mkdir -p /data /data/config && \
chown -R supernote:supernote /data
# Switch to non-root user
USER supernote
EXPOSE 8000
VOLUME ["/data"]
CMD ["supernote-server", "serve"]