-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile.init.example
More file actions
28 lines (22 loc) · 894 Bytes
/
Copy pathdockerfile.init.example
File metadata and controls
28 lines (22 loc) · 894 Bytes
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
# Category: Init
# Service: Docker NodeJS Initialization Dockerfile
# Description: Initialization environment for Node.js to bootstrap the application.
# Maintainer: ryumada
# STAGE 0: Base image with system dependencies (Cached)
FROM node:${DOCKER_NODEJS_TAG} AS base
RUN apk add --no-cache libc6-compat python3 make g++ shadow
# STAGE 1: Initialization environment
FROM base AS init
# Add user and group with matching IDs from the host to fix permissions
ARG HOST_USER_ID
ARG HOST_GROUP_ID
RUN groupmod -g ${HOST_GROUP_ID} node && \
usermod -u ${HOST_USER_ID} -g ${HOST_GROUP_ID} node
USER node
WORKDIR /usr/src/app
# Hardening: Disable Next.js telemetry
ENV NEXT_TELEMETRY_DISABLED=1
# No COPY commands here because we are initializing an empty project
# The source code will be generated inside the volume mount
# Start the container and keep it running
CMD ["sleep", "infinity"]