Commit 31365f3 1 parent 4f4f996 commit 31365f3 Copy full SHA for 31365f3
File tree 2 files changed +21
-17
lines changed
2 files changed +21
-17
lines changed Original file line number Diff line number Diff line change @@ -31,22 +31,31 @@ FROM node:16.13.2-alpine
31
31
ENV PORT=80 \
32
32
DIRECTORY=/app \
33
33
IS_DOCKER=true \
34
- UID=1000 \
35
- GUID=1000
34
+ USER=docker \
35
+ UID=12345 \
36
+ GID=23456
36
37
37
- # Create a group and user
38
- RUN addgroup --gid ${GUID} application \
39
- && adduser --no-create-home --uid ${UID} application application
38
+ # Install tini for initialization and tzdata for setting timezone
39
+ RUN apk add --no-cache tzdata tini \
40
+ # Add group
41
+ && addgroup --gid ${GID} "${USER}" \
42
+ # Add user
43
+ && adduser \
44
+ --disabled-password \
45
+ --ingroup "${USER}" \
46
+ --gecos "" \
47
+ --home "${DIRECTORY}" \
48
+ --no-create-home \
49
+ --uid "$UID" \
50
+ "$USER"
51
+
52
+ USER ${USER}
40
53
41
- USER application
42
54
# Create and set the working directory
43
55
WORKDIR ${DIRECTORY}
44
56
45
- # Install tini for initialization and tzdata for setting timezone
46
- RUN apk add --no-cache tzdata tini
47
-
48
57
# Copy built application from build phase
49
- COPY --from=BUILD_IMAGE /app ./
58
+ COPY --from=BUILD_IMAGE --chown=${USER}:${USER} /app ./
50
59
51
60
# Finally, run start command to serve up the built application
52
61
ENTRYPOINT [ "/sbin/tini" , "--" ]
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ services:
7
7
container_name : Dashy
8
8
9
9
# Pull latest image from DockerHub
10
- image : lissy93/dashy
10
+ # image: lissy93/dashy
11
11
12
12
# To build from source, replace 'image: lissy93/dashy' with 'build: .'
13
- # build: .
13
+ build : .
14
14
15
15
# Or, to use a Dockerfile for your archtecture, uncomment the following
16
16
# context: .
@@ -32,11 +32,6 @@ services:
32
32
environment :
33
33
- NODE_ENV=production
34
34
# Specify your user ID and group ID. You can find this by running `id -u` and `id -g`
35
- # - UID=1000
36
- # - GID=1000
37
-
38
- # Specify restart policy
39
- restart : unless-stopped
40
35
41
36
# Configure healthchecks
42
37
healthcheck :
You can’t perform that action at this time.
0 commit comments