Commit 416b7b7d authored by Sebastien Moretti's avatar Sebastien Moretti
Browse files

Install UCNEbase database in the container

parent a3b673c7
......@@ -22,33 +22,40 @@ LABEL org.opencontainers.image.created=$BUILD_DATE
# INSTALLATION
ENV USER=ucnebase
#ENV USER=ucnebase
# In a single layer to save time AND space
RUN echo '# OS update' \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update -y \
&& echo '# Install OS requirements' \
&& apt-get install -y --no-install-recommends perl libcgi-pm-perl postfix wget git mysql-server apache2 ca-certificates php-mysqlnd \
&& echo 'perl perl-CGI httpd postfix rsyslog-mysql wget git php-mysqlnd' \
&& echo '# Install UCNEbase' \
&& cd /usr/local/ \
&& git clone https://gitlab.sib.swiss/EPD/UCNEbase_web.git UCNEbase_web.git \
&& cd UCNEbase_web.git/ \
&& rm -Rf OLD/ .git* docker/ \
&& echo '# Install UCNEbase database' \
&& service mysql start \
&& mysql -u root -e 'CREATE DATABASE `UGRB`' \
&& mysql -u root -e "CREATE USER 'epd'@'localhost' IDENTIFIED BY 'Xaga8]aYulgx+6'" \
&& mysql -u root -e 'GRANT SELECT ON `UGRB`.* TO `epd`@`localhost`' \
&& gunzip -c /usr/local/UCNEbase_web.git/htdocs/data/download/mysql_data/UCNEbase_v_2_0.sql.gz >/tmp/UCNEbase_v_2_0.sql \
&& mysql -u root UGRB </tmp/UCNEbase_v_2_0.sql \
&& rm -f /tmp/UCNEbase_v_2_0.sql \
&& echo '# CLEANING' \
&& echo '## So try to remove manually useless stuff' \
&& apt remove -y *-dev wget cmake make swig autoconf check gcc g++ gfortran python3* patchelf \
&& apt autoremove -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& groupadd -g 1001 ${USER} && useradd -r -u 1001 -g ${USER} ${USER}
&& rm -rf /var/lib/apt/lists/*
# && groupadd -g 1001 ${USER} && useradd -r -u 1001 -g ${USER} ${USER}
# SECURITY
## Control root access
USER ${USER}
ENV HOME=/home/${USER}
WORKDIR ${HOME}
#USER ${USER}
#ENV HOME=/home/${USER}
#WORKDIR ${HOME}
##Rest of Dockerfile with this user
ENV LC_ALL="C"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment