forked from dullage/flatnotes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (36 loc) · 1017 Bytes
/
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
ARG BUILD_DIR=/build
# Build Container
FROM --platform=$BUILDPLATFORM python:3.11-slim-bullseye AS build
ARG BUILD_DIR
RUN mkdir ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN apt update && apt install -y npm
COPY package.json package-lock.json .htmlnanorc ./
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 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 pipenv
WORKDIR ${APP_PATH}
COPY LICENSE Pipfile Pipfile.lock ./
RUN pipenv install --deploy --ignore-pipfile --system
COPY server ./server
COPY --from=build ${BUILD_DIR}/client/dist ./client/dist
VOLUME /data
EXPOSE 8080/tcp
HEALTHCHECK --interval=60s --timeout=10s CMD curl -f http://localhost:8080/health || exit 1
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]