mirror of
https://github.com/senaite/senaite.docker.git
synced 2024-09-20 06:56:03 +08:00
Allow to set password
This commit is contained in:
parent
d9b7e92048
commit
184faac528
|
@ -24,49 +24,41 @@ RUN useradd --system -m -d $SENAITE_HOME -U -u 500 $SENAITE_USER
|
|||
# Create directories
|
||||
RUN mkdir -p $SENAITE_INSTANCE_HOME $SENAITE_FILESTORAGE $SENAITE_BLOBSTORAGE
|
||||
|
||||
# Copy the build dependencies
|
||||
COPY build_deps.txt /
|
||||
# Copy Buildout
|
||||
COPY requirements.txt buildout.cfg $SENAITE_INSTANCE_HOME
|
||||
|
||||
# Copy the runtime dependencies
|
||||
COPY run_deps.txt /
|
||||
# Copy the build dependencies and startup scripts
|
||||
COPY build_deps.txt run_deps.txt docker-initialize.py docker-entrypoint.sh /
|
||||
|
||||
# Install package dependencies
|
||||
RUN apt-get update
|
||||
RUN apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ")
|
||||
RUN apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /run_deps.txt | tr "\n" " ")
|
||||
|
||||
# Fetch unified installer
|
||||
RUN wget -O Plone.tgz https://launchpad.net/plone/$PLONE_MAJOR/$PLONE_VERSION/+download/$PLONE_UNIFIED_INSTALLER.tgz \
|
||||
# Note: we concatenate all commands to avoid multiple layer generation and reduce the image size
|
||||
RUN apt-get update \
|
||||
# Install system packages
|
||||
&& apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ") \
|
||||
&& apt-get install -y --no-install-recommends $(grep -vE "^\s*#" /run_deps.txt | tr "\n" " ") \
|
||||
# Fetch unified installer
|
||||
&& wget -O Plone.tgz https://launchpad.net/plone/$PLONE_MAJOR/$PLONE_VERSION/+download/$PLONE_UNIFIED_INSTALLER.tgz \
|
||||
&& echo "$PLONE_MD5 Plone.tgz" | md5sum -c - \
|
||||
&& tar -xzf Plone.tgz \
|
||||
&& cp -rv /$PLONE_UNIFIED_INSTALLER/base_skeleton/* $SENAITE_INSTANCE_HOME \
|
||||
&& cp -v /$PLONE_UNIFIED_INSTALLER/buildout_templates/buildout.cfg $SENAITE_INSTANCE_HOME/buildout-base.cfg \
|
||||
&& cd $SENAITE_HOME \
|
||||
&& rm -rf /$PLONE_UNIFIED_INSTALLER /Plone.tgz
|
||||
&& tar -xzf /Plone.tgz \
|
||||
&& cp -rv $PLONE_UNIFIED_INSTALLER/base_skeleton/* $SENAITE_INSTANCE_HOME \
|
||||
&& cp -v $PLONE_UNIFIED_INSTALLER/buildout_templates/buildout.cfg $SENAITE_INSTANCE_HOME/buildout-base.cfg \
|
||||
&& rm -rf $PLONE_UNIFIED_INSTALLER Plone.tgz \
|
||||
# Buildout
|
||||
&& cd $SENAITE_INSTANCE_HOME \
|
||||
&& pip install -r requirements.txt \
|
||||
&& buildout \
|
||||
&& ln -s $SENAITE_FILESTORAGE/ var/filestorage \
|
||||
&& ln -s $SENAITE_BLOBSTORAGE/ var/blobstorage \
|
||||
&& chown -R senaite:senaite $SENAITE_HOME $SENAITE_DATA \
|
||||
# Cleanup
|
||||
&& apt-get purge -y --auto-remove $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ") \
|
||||
&& rm -rf /$SENAITE_HOME/buildout-cache \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Change working directory
|
||||
WORKDIR $SENAITE_INSTANCE_HOME
|
||||
|
||||
# Copy Buildout
|
||||
COPY requirements.txt buildout.cfg ./
|
||||
|
||||
# Buildout
|
||||
RUN pip install -r requirements.txt \
|
||||
&& buildout \
|
||||
&& ln -s $SENAITE_FILESTORAGE/ var/filestorage \
|
||||
&& ln -s $SENAITE_BLOBSTORAGE/ var/blobstorage \
|
||||
&& chown -R senaite:senaite $SENAITE_HOME $SENAITE_DATA
|
||||
|
||||
# Cleanup
|
||||
RUN apt-get purge -y --auto-remove $(grep -vE "^\s*#" /build_deps.txt | tr "\n" " ")
|
||||
RUN rm -rf /$SENAITE_HOME/buildout-cache
|
||||
RUN rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Mount external volume
|
||||
# VOLUME /data
|
||||
|
||||
# Copy startup scripts
|
||||
COPY docker-initialize.py docker-entrypoint.sh /
|
||||
VOLUME /data
|
||||
|
||||
# Expose instance port
|
||||
EXPOSE 8080
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Note: Changing the latest PR will force a new buildout run and therefore, a
|
||||
# new git checkout of the senaite sources!
|
||||
#
|
||||
# Latest `senaite.core` PR: #1928
|
||||
# Latest `senaite.core` PR: #1933
|
||||
[buildout]
|
||||
index = https://pypi.python.org/simple/
|
||||
extends =
|
||||
|
@ -20,7 +20,8 @@ download-cache=../buildout-cache/downloads
|
|||
parts +=
|
||||
zeo
|
||||
plonesite
|
||||
|
||||
client_reserved
|
||||
console_scripts
|
||||
|
||||
eggs +=
|
||||
senaite.lims
|
||||
|
@ -54,6 +55,14 @@ event-log-args = (sys.stderr,)
|
|||
access-log-handler = StreamHandler
|
||||
access-log-args = (sys.stdout,)
|
||||
|
||||
[client_reserved]
|
||||
<= instance_base
|
||||
recipe = plone.recipe.zope2instance
|
||||
http-address = 8089
|
||||
|
||||
[console_scripts]
|
||||
recipe = zc.recipe.egg:scripts
|
||||
eggs = senaite.core
|
||||
|
||||
[plonesite]
|
||||
recipe = collective.recipe.plonesite
|
||||
|
|
|
@ -25,6 +25,11 @@ if [[ "$1" == "zeo"* ]]; then
|
|||
exec gosu senaite bin/$1 fg
|
||||
fi
|
||||
|
||||
# Change the password
|
||||
if [[ -n "${PASSWORD}" ]]; then
|
||||
gosu senaite bin/zope-passwd -p "${PASSWORD}"
|
||||
fi
|
||||
|
||||
# Instance start
|
||||
if [[ $START == *"$1"* ]]; then
|
||||
exec gosu senaite bin/instance console
|
||||
|
|
|
@ -11,3 +11,4 @@ libxml2
|
|||
libxslt1.1
|
||||
lynx
|
||||
rsync
|
||||
vim
|
||||
|
|
Loading…
Reference in a new issue