Skip to content

Commit 1f341d4

Browse files
committed
Use the node user that comes with node:alpine
1 parent c152e74 commit 1f341d4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

Dockerfile

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
11
FROM node:22-alpine AS base
22

3+
4+
ARG USER=node
5+
ENV HOME /home/$USER
6+
37
# Alpine doesn't have curl, so add it
48
RUN apk --no-cache add curl
59

6-
ARG USER=si-user
7-
ENV HOME /home/$USER
8-
RUN adduser -D $USER \
9-
&& mkdir -p /etc/sudoers.d \
10-
&& echo "$USER ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$USER \
11-
&& chmod 0440 /etc/sudoers.d/$USER
12-
1310
# Set the working directory inside the container
1411
USER $USER
1512
WORKDIR $HOME/app
1613

1714
# Copy the package.json and lock file to install dependencies
18-
COPY package.json package-lock.json panda.config.ts ./
15+
COPY --chown=$USER:$USER package.json package-lock.json panda.config.ts ./
1916

2017
# Install dependencies
2118
RUN npm install
2219

2320
# Copy the rest of the application files
24-
COPY . .
21+
COPY --chown=$USER:$USER . .
2522

2623
# Build the Next.js app
2724
RUN npm run build

0 commit comments

Comments
 (0)