-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add comments and merge volumes into single layer
- Loading branch information
1 parent
d685a21
commit d006d8b
Showing
1 changed file
with
19 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,43 @@ | ||
FROM node:20.10.0-bullseye-slim | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
VOLUME [ "/app/db" ] | ||
VOLUME [ "/app/assets" ] | ||
VOLUME [ "/app/dist/assets" ] | ||
VOLUME [ "/app/extras" ] | ||
|
||
# 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 | ||
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 | ||
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"] | ||
CMD ["run", "server"] |