First version of adding profiles in different directory
This commit is contained in:
parent
f4334c8a58
commit
9a7acfbb86
@ -18,7 +18,7 @@ ENV APACHE_RUN_USER=www-data APACHE_RUN_GROUP=www-data \
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
VOLUME /var/lib/ocsinventory-reports /etc/ocsinventory-server /usr/share/ocsinventory-reports/ocsreports/extensions
|
||||
VOLUME /var/lib/ocsinventory-reports /etc/ocsinventory-server /usr/share/ocsinventory-reports/ocsreports/extensions /var/lib/profile-config
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
wget \
|
||||
@ -69,6 +69,10 @@ COPY ./docker-entrypoint.d /docker-entrypoint.d
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
# Copy the volume content to profile directory
|
||||
RUN rm -r /usr/share/ocsinventory-reports/ocsreports/config/profiles
|
||||
COPY -r ./var/lib/profile-config /usr/share/ocsinventory-reports/ocsreports/config/profiles
|
||||
|
||||
# https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#entrypoint
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
CMD ["/usr/sbin/apache2", "-DFOREGROUND"]
|
||||
|
||||
@ -12,6 +12,7 @@ services:
|
||||
- "ocsreportsdata:/usr/share/ocsinventory-reports/ocsreports/extensions"
|
||||
- "varlibdata:/var/lib/ocsinventory-reports"
|
||||
- "httpdconfdata:/etc/apache2/conf-available"
|
||||
- "profilesdata:/var/lib/profile-config"
|
||||
environment:
|
||||
OCS_DB_SERVER: ocsinventory-db
|
||||
OCS_DB_USER: ocsuser
|
||||
@ -83,4 +84,5 @@ volumes:
|
||||
varlibdata:
|
||||
httpdconfdata:
|
||||
sqldata:
|
||||
profilesdata:
|
||||
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
#!/bin/bash
|
||||
PROFILE_CONF_DIRECTORY="/usr/share/ocsinventory-reports/ocsreports/config/profiles"
|
||||
PROFILE_CONF_DIRECTORY_VOLUME="/var/lib/profile-config"
|
||||
|
||||
echo "+----------------------------------------------------------+"
|
||||
echo "| Setting Apache Server Name to '${APACHE_SERVER_NAME:-localhost}'"
|
||||
@ -27,6 +29,13 @@ if [ -f "$APACHE_PID_FILE" ]; then
|
||||
rm "$APACHE_PID_FILE"
|
||||
fi
|
||||
|
||||
# Configure profile folder
|
||||
if [ ! -f ${PROFILE_CONF_DIRECTORY} ]; then
|
||||
mkdir "$PROFILE_CONF_DIRECTORY_VOLUME"
|
||||
chown $APACHE_RUN_USER:$APACHE_RUN_GROUP "$PROFILE_CONF_DIRECTORY_VOLUME"
|
||||
cp -r ${PROFILE_CONF_DIRECTORY} ${PROFILE_CONF_DIRECTORY_VOLUME}
|
||||
fi
|
||||
|
||||
echo "+----------------------------------------------------------+"
|
||||
echo "| OK, prepare finshed ;-) |"
|
||||
echo "| |"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user