mirror of
https://github.com/zadam/trilium.git
synced 2025-11-04 20:36:13 +01:00
chore(nx/docker): basic integration
This commit is contained in:
17
apps/server/Dockerfile
Normal file
17
apps/server/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
||||
FROM node:22.14.0-alpine
|
||||
|
||||
# Install runtime dependencies
|
||||
RUN apk add --no-cache su-exec shadow
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
COPY /apps/server/dist /usr/src/app
|
||||
COPY /apps/server/start-docker.sh /usr/src/app
|
||||
|
||||
# Add application user
|
||||
RUN adduser -s /bin/false node; exit 0
|
||||
|
||||
# Configure container
|
||||
EXPOSE 8080
|
||||
CMD [ "sh", "./start-docker.sh" ]
|
||||
HEALTHCHECK --start-period=10s CMD exec su-exec node node docker_healthcheck.js
|
||||
@@ -152,6 +152,12 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"docker-build": {
|
||||
"dependsOn": [
|
||||
"build"
|
||||
],
|
||||
"command": "docker build -f apps/server/Dockerfile . -t triliumnext"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
7
apps/server/start-docker.sh
Normal file
7
apps/server/start-docker.sh
Normal file
@@ -0,0 +1,7 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ ! -z "${USER_UID}" ] && usermod -u ${USER_UID} node || echo "No USER_UID specified, leaving 1000"
|
||||
[ ! -z "${USER_GID}" ] && groupmod -og ${USER_GID} node || echo "No USER_GID specified, leaving 1000"
|
||||
|
||||
chown -R node:node /home/node
|
||||
exec su -c "node ./main" node
|
||||
Reference in New Issue
Block a user