Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @alexcos20 @bogdanfazakas @giurgiur99 @denisiuriet @ndrpp @andreip136
* @alexcos20 @bogdanfazakas @giurgiur99 @dnsi0 @ndrpp @andreip136
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,8 @@ ENV NODE_ENV=production \

EXPOSE 9000 9001 9002 9003 9005 8000

# GID of the docker group on the host. Needs to match so the node user can access
# /var/run/docker.sock for compute jobs. Default is 999 (common on Debian/Ubuntu).
# Override at build time if your host differs: docker build --build-arg DOCKER_GID=$(getent group docker | cut -d: -f3) .
ARG DOCKER_GID=999
RUN groupadd -g ${DOCKER_GID} docker && usermod -aG docker node
# Docker group membership is handled at runtime in docker-entrypoint.sh by
# inspecting the GID of /var/run/docker.sock, so it works across hosts.

WORKDIR /usr/src/app

Expand Down
11 changes: 11 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@ set -e
# Runs as root, then drops to 'node' user via gosu.
chown -R node:node /usr/src/app/databases /usr/src/app/c2d_storage /usr/src/app/logs 2>/dev/null || true

# Add node user to the docker group matching the host's /var/run/docker.sock GID,
# so compute jobs can access the socket regardless of the host's docker GID.
if [ -S /var/run/docker.sock ]; then
SOCK_GID=$(stat -c '%g' /var/run/docker.sock)
if ! getent group "$SOCK_GID" > /dev/null 2>&1; then
groupadd -g "$SOCK_GID" dockerhost 2>/dev/null || true
fi
DOCKER_GROUP=$(getent group "$SOCK_GID" | cut -d: -f1)
usermod -aG "$DOCKER_GROUP" node
fi

exec gosu node dumb-init -- "$@"
Loading