forked from pbogre/jetlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
53 lines (39 loc) · 1.05 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
# BUILD
ARG BUILD_PATH=/build
FROM --platform=$BUILDPLATFORM node:bookworm-slim AS build
ARG BUILD_PATH
RUN mkdir ${BUILD_PATH}
WORKDIR ${BUILD_PATH}
RUN apt-get update -y && apt-get upgrade -y
COPY package.json ./
RUN npm i --package-lock-only
RUN npm ci
COPY ./client ./client
COPY ./tailwind.config.js ./.postcssrc ./
RUN npm run build
# RUNTIME
FROM python:3.11-slim-bookworm
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get install -y gosu sqlite3 && rm -rf /var/lib/apt/lists/*
RUN pip install pipenv
# environment variables
ENV PUID=1000
ENV PGID=1000
ENV APP_PATH=/app
ENV DATA_PATH=/data
ENV JETLOG_PORT=3000
ENV TOKEN_DURATION=7
RUN mkdir -p ${APP_PATH}
RUN mkdir -p ${DATA_PATH}
WORKDIR ${APP_PATH}
# install python dependencies
COPY Pipfile Pipfile.lock ./
RUN pipenv install --system --deploy
COPY ./server ${APP_PATH}/server
COPY ./data ${APP_PATH}/data
COPY --from=build /build/dist ${APP_PATH}/dist
VOLUME ${DATA_PATH}
EXPOSE ${JETLOG_PORT}/tcp
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]