forked from dullage/flatnotes
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile
More file actions
55 lines (44 loc) · 1.72 KB
/
Containerfile
File metadata and controls
55 lines (44 loc) · 1.72 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
FROM public.ecr.aws/docker/library/node:lts-trixie AS builder
ENV NPM_CONFIG_UPDATE_NOTIFIER=false
WORKDIR /app/build
COPY .htmlnanorc package.json package-lock.json \
postcss.config.js tailwind.config.js vite.config.js \
./
COPY client ./client
RUN npm ci --no-fund \
&& npm run build
# Runtime Container
FROM public.ecr.aws/docker/library/python:3.13.13-slim-trixie
LABEL org.opencontainers.image.source=https://github.com/rubberverse/flatnotes
LABEL org.opencontainers.image.description="Self-hosted, database-less note-taking web app"
LABEL org.opencontainers.image.licenses=MIT
ARG CONT_USER=flatnotes \
CONT_UID=1100
ENV FLATNOTES_HOST=0.0.0.0 \
FLATNOTES_PORT=9102 \
APP_PATH=/app \
FLATNOTES_PATH=/app/data \
DEBIAN_FRONTEND=noninteractive
WORKDIR /app
COPY Pipfile Pipfile.lock ./
RUN apt update \
&& apt upgrade -y \
&& pip install pipenv --break-system-packages --root-user-action=ignore \
&& addgroup \
--system \
--gid ${CONT_UID} \
${CONT_USER} \
&& adduser \
--home "/app" \
--shell "/bin/false" \
--uid ${CONT_UID} \
--ingroup ${CONT_USER} \
--disabled-password \
${CONT_USER} \
&& rm -rf /var/cache/apt \
&& pipenv install --deploy --ignore-pipfile --system \
&& pipenv --clear
COPY --chmod=555 server ./server
COPY --from=builder --chmod=777 /app/build/client/dist ./client/dist
USER ${CONT_UID}:${CONT_UID}
ENTRYPOINT [ "python3", "-m", "uvicorn", "main:app", "--app-dir", "server", "--host", "0.0.0.0", "--port", "9102", "--proxy-headers", "--forwarded-allow-ips", "'*'" ]