-
-
Notifications
You must be signed in to change notification settings - Fork 94
/
Dockerfile
63 lines (44 loc) · 1.2 KB
/
Dockerfile
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
ARG BUILD_DIR=/build
# Build Container
FROM --platform=$BUILDPLATFORM node:20-alpine AS build
ARG BUILD_DIR
RUN mkdir ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
COPY .htmlnanorc \
package.json \
package-lock.json \
postcss.config.js \
tailwind.config.js \
vite.config.js \
./
RUN npm ci
COPY client ./client
RUN npm run build
# Runtime Container
FROM python:3.11-slim-bullseye
ARG BUILD_DIR
ENV PUID=1000
ENV PGID=1000
ENV EXEC_TOOL=gosu
ENV FLATNOTES_PORT=8080
ENV APP_PATH=/app
ENV FLATNOTES_PATH=/data
RUN mkdir -p ${APP_PATH}
RUN mkdir -p ${FLATNOTES_PATH}
RUN apt update && apt install -y \
curl \
gosu \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir pipenv
WORKDIR ${APP_PATH}
COPY LICENSE Pipfile Pipfile.lock ./
RUN pipenv install --deploy --ignore-pipfile --system && \
pipenv --clear
COPY server ./server
COPY --from=build --chmod=777 ${BUILD_DIR}/client/dist ./client/dist
COPY entrypoint.sh healthcheck.sh /
RUN chmod +x /entrypoint.sh /healthcheck.sh
VOLUME /data
EXPOSE ${FLATNOTES_PORT}/tcp
HEALTHCHECK --interval=60s --timeout=10s CMD /healthcheck.sh
ENTRYPOINT [ "/entrypoint.sh" ]