-
Notifications
You must be signed in to change notification settings - Fork 20
/
Dockerfile
37 lines (37 loc) · 1.48 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM ubuntu:focal
ARG UNIX_USER=lamachine
ARG LAMACHINE_PATH=/lamachine
ARG DATA_PATH=/data
ARG LM_NAME=docker
ARG HOSTNAME=lamachine-docker
ARG ANSIBLE_OPTIONS="-vvv"
ARG LM_VERSION=unknown
EXPOSE 80
EXPOSE 8080
EXPOSE 8888
EXPOSE 9999
USER root
LABEL org.opencontainers.image.authors="Maarten van Gompel <proycon@anaproy.nl>"
LABEL description="A unified distribution of NLP software. Developed by the Centre of Language and Speech Technology (Radboud University Nijmegen), the KNAW Humanities Cluster. Funded by CLARIAH" value="$LM_VERSION"
VOLUME $DATA_PATH
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update && apt-get install -m -y python3 python3-pip sudo apt-utils locales software-properties-common ansible
#RUN apt-add-repository --yes --update ppa:ansible/ansible
#RUN apt-get update && apt-get install -m -y ansible
RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen
RUN useradd -ms /bin/bash $UNIX_USER
RUN echo "$UNIX_USER:lamachine" | chpasswd
RUN adduser $UNIX_USER sudo
RUN echo "$UNIX_USER ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN mkdir $LAMACHINE_PATH
COPY . $LAMACHINE_PATH
COPY host_vars/$HOSTNAME.yml $LAMACHINE_PATH/host_vars/localhost.yml
RUN chown -R $UNIX_USER $LAMACHINE_PATH
USER $UNIX_USER
ENV ANSIBLE_CFG=$LAMACHINE_PATH/ansible.cfg
RUN ln -s $LAMACHINE_PATH/ansible.cfg /home/$UNIX_USER/.ansible.cfg
RUN ansible-playbook $ANSIBLE_OPTIONS $LAMACHINE_PATH/install.yml -c local
RUN sudo ldconfig
WORKDIR /home/$UNIX_USER
CMD /bin/bash -l