-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
Dockerfile
43 lines (33 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
FROM node:20.10.0-bullseye-slim
# Set working directory
WORKDIR /app
# Define volumes for persistent data storage
VOLUME [ "/app/db", "/app/assets", "/app/dist/assets", "/app/extras" ]
# Install pnpm globally
RUN npm install [email protected] -g
# SHA used for versioning
ARG SHA=unknown
# Add package files and install dependencies
ADD package.json pnpm-lock.yaml ./
RUN pnpm i --frozen-lockfile
# Add configuration and source files
ADD tailwind.config.js tsconfig.json .babelrc .postcssrc .prettierrc srv.tsconfig.json ./
ADD common/ ./common/
ADD srv/ ./srv/
ADD web/ ./web
# Build the server and replace SHA in index.html
RUN pnpm run build:server && \
sed -i "s/{{unknown}}/${SHA}/g" /app/web/index.html && \
pnpm run build && mkdir -p /app/assets && \
echo "${SHA}" > /app/version.txt
# Set environment variables
ENV LOG_LEVEL=info \
INITIAL_USER=administrator \
DB_NAME=agnai \
ASSET_FOLDER=/app/dist/assets
# Expose application ports
EXPOSE 3001
EXPOSE 5001
# Set the entry point and default command
ENTRYPOINT [ "pnpm" ]
CMD ["run", "server"]