File tree 1 file changed +29
-19
lines changed
1 file changed +29
-19
lines changed Original file line number Diff line number Diff line change 5
5
# Apply security patches
6
6
# hadolint ignore=DL3018
7
7
RUN echo 'http://dl-3.alpinelinux.org/alpine/edge/community' >> /etc/apk/repositories \
8
- && echo 'http://dl-3.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
9
- && apk add --no-cache \
10
- bash \
11
- curl \
12
- libressl \
13
- mariadb-client \
14
- mongodb-tools \
15
- mysql \
16
- postgresql \
17
- tini \
18
- && apk add --upgrade --no-cache \
19
- db \
20
- expat \
21
- freetype \
22
- fontconfig \
23
- libpng \
24
- ncurses \
25
- zlib
8
+ && echo 'http://dl-3.alpinelinux.org/alpine/edge/main' >> /etc/apk/repositories \
9
+ && apk add --no-cache \
10
+ bash \
11
+ curl \
12
+ libressl \
13
+ mariadb-client \
14
+ mongodb-tools \
15
+ mysql \
16
+ postgresql \
17
+ tini \
18
+ && apk add --upgrade --no-cache \
19
+ db \
20
+ expat \
21
+ freetype \
22
+ fontconfig \
23
+ libpng \
24
+ ncurses \
25
+ zlib
26
26
27
27
# RUN curl -sL https://sentry.io/get-cli/ | bash
28
28
@@ -35,7 +35,17 @@ RUN python -m pip install --upgrade pip
35
35
RUN pip install setuptools==57.5.0
36
36
RUN pip install -r ./requirements.txt
37
37
38
- COPY ./docker-entrypoint.sh /
38
+ # install sudo as root
39
+ RUN apk add --no-cache --update sudo
40
+
41
+ # add new user
42
+ RUN adduser -D myapp \
43
+ && echo "myapp ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/myapp \
44
+ && chmod 0440 /etc/sudoers.d/myapp
45
+
46
+ COPY --chown=myapp ./docker-entrypoint.sh /
47
+ RUN mkdir /backups && chown myapp /backups
48
+ USER myapp
39
49
40
50
VOLUME ["/backups" ]
41
51
ENTRYPOINT ["/sbin/tini" , "--" ]
You can’t perform that action at this time.
0 commit comments