# Thanks to https://vsupalov.com/docker-arg-vs-env/
ARG DEBIAN_FRONTEND=noninteractive
FROM debian_updated:latest
ENV TERM=linux
ENV PYTHONUNBUFFERED=1
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_US.UTF-8
ENV TZ=Europe/Brussels

# Install sudo package and disable password prompt for sudoers
RUN apt-get install -yqq sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers

# create a user lino
RUN adduser --disabled-password --gecos '' lino
RUN adduser lino sudo
RUN adduser lino www-data

USER lino

# create /src directory and copy required project source files to the image
RUN sudo  mkdir /src
RUN sudo chown lino:lino -R /src
# RUN echo 1; pwd ; ls -l

# RUN sudo -H getlino configure --batch --db-engine postgresql --db-port 5432 && sudo -H getlino startsite --batch noi mysite1 --dev-repos "lino noi xl"
