Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +11 -4
Dockerfile
CHANGED
|
@@ -33,10 +33,17 @@ RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
|
|
| 33 |
# Create a working directory
|
| 34 |
WORKDIR /app
|
| 35 |
|
| 36 |
-
# Create a non-root user and switch to it
|
| 37 |
-
RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 38 |
-
|
| 39 |
-
RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
USER user
|
| 41 |
|
| 42 |
# All users can use /home/user as their home directory
|
|
|
|
| 33 |
# Create a working directory
|
| 34 |
WORKDIR /app
|
| 35 |
|
| 36 |
+
# # Create a non-root user and switch to it
|
| 37 |
+
# RUN adduser --disabled-password --gecos '' --shell /bin/bash user \
|
| 38 |
+
# && chown -R user:user /app
|
| 39 |
+
# RUN echo "user ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/90-user
|
| 40 |
+
|
| 41 |
+
# Create user and setup permissions on /etc/sudoers
|
| 42 |
+
RUN useradd -m -s /bin/bash -N -u 1000 user && \
|
| 43 |
+
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers && \
|
| 44 |
+
chmod 0440 /etc/sudoers && \
|
| 45 |
+
chmod g+w /etc/passwd
|
| 46 |
+
|
| 47 |
USER user
|
| 48 |
|
| 49 |
# All users can use /home/user as their home directory
|