Skip to content

Commit 16383e7

Browse files
committed
Dockerfile: ensure appuser is created and used to run pyxterm server
1 parent 5a50a2b commit 16383e7

File tree

1 file changed

+8
-20
lines changed

1 file changed

+8
-20
lines changed

Dockerfile

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,42 +3,30 @@ FROM ubuntu:20.04
33
RUN apt-get update --fix-missing
44
RUN apt-get install -y \
55
apt-utils \
6-
# curl \
7-
# g++ \
8-
# gcc \
9-
# make \
106
python3 \
117
python3-pip \
128
vim \
139
zsh
1410

15-
#prepare arduino-cli for container (install as root)
16-
#RUN curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
17-
1811
COPY . /var/www
1912
WORKDIR "/var/www"
2013

2114
RUN pip3 install -r requirements.txt
2215

23-
# Set user and group
24-
#ARG user=appuser
25-
#ARG group=appuser
26-
#ARG uid=1000
27-
#ARG gid=1000
28-
#RUN groupadd -g ${gid} ${group}
29-
#RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user} # <--- the '-m' create a user home directory
30-
#RUN usermod -a -G dialout ${user}
16+
# Setup appuser and appgroup
17+
ARG user=appuser
18+
ARG group=appuser
19+
ARG uid=1000
20+
ARG gid=1000
21+
RUN groupadd -g ${gid} ${group}
22+
RUN useradd -u ${uid} -g ${group} -s /bin/sh -m ${user} # <--- the '-m' create a user home directory
3123

3224
COPY _assets/.zshrc /home/appuser/.zshrc
3325
COPY _assets/oh-my-zsh /home/appuser/.oh-my-zsh
3426

3527
# Switch to user we must not set group to make the configuration done above apply
3628
# !! if ${user} is not setup correctly the next line might result in group being root !!
37-
#USER ${user}
38-
39-
#prepare our arduino env (as user)
40-
#RUN arduino-cli upgrade
41-
#RUN arduino-cli core install arduino:avr
29+
USER ${user}
4230

4331
EXPOSE 5000
4432

0 commit comments

Comments
 (0)