Hooks for persistent storage
This commit is contained in:
parent
f13ffb4c91
commit
4bb57366f7
@ -30,6 +30,17 @@ RUN set -x; \
|
||||
&& apt-get -y install -f --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/* odoo.deb
|
||||
|
||||
# grab gosu for easy step-down from root
|
||||
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
|
||||
RUN set -x; \
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
|
||||
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
|
||||
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy entrypoint script and Odoo configuration file
|
||||
COPY ./entrypoint.sh /
|
||||
COPY ./openerp-server.conf /etc/odoo/
|
||||
@ -46,8 +57,5 @@ EXPOSE 8069 8071
|
||||
# Set the default config file
|
||||
ENV OPENERP_SERVER /etc/odoo/openerp-server.conf
|
||||
|
||||
# Set default user when running the container
|
||||
USER odoo
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["openerp-server"]
|
||||
|
@ -9,16 +9,26 @@ set -e
|
||||
: ${PGPASSWORD:=$DB_ENV_POSTGRES_PASSWORD}
|
||||
export PGHOST PGPORT PGUSER PGPASSWORD
|
||||
|
||||
if [[ ! -f /var/lib/odoo/etc/openerp-server.conf ]]; then
|
||||
mkdir -p /var/lib/odoo/etc
|
||||
mv /etc/odoo/openerp-server.conf /var/lib/odoo/etc/openerp-server.conf
|
||||
else
|
||||
rm -f /etc/odoo/openerp-server.conf
|
||||
fi
|
||||
ln -s /var/lib/odoo/etc/openerp-server.conf /etc/odoo/openerp-server.conf
|
||||
chown -R odoo /var/lib/odoo
|
||||
|
||||
|
||||
case "$1" in
|
||||
--)
|
||||
shift
|
||||
exec openerp-server "$@"
|
||||
exec gosu odoo openerp-server "$@"
|
||||
;;
|
||||
-*)
|
||||
exec openerp-server "$@"
|
||||
exec gosu odoo openerp-server "$@"
|
||||
;;
|
||||
*)
|
||||
exec "$@"
|
||||
exec gosu odoo "$@"
|
||||
esac
|
||||
|
||||
exit 1
|
||||
|
@ -30,6 +30,17 @@ RUN set -x; \
|
||||
&& apt-get -y install -f --no-install-recommends \
|
||||
&& rm -rf /var/lib/apt/lists/* odoo.deb
|
||||
|
||||
# grab gosu for easy step-down from root
|
||||
RUN gpg --keyserver pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4
|
||||
RUN set -x; \
|
||||
apt-get update && apt-get install -y --no-install-recommends ca-certificates curl \
|
||||
&& curl -o /usr/local/bin/gosu -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture)" \
|
||||
&& curl -o /usr/local/bin/gosu.asc -SL "https://github.com/tianon/gosu/releases/download/1.2/gosu-$(dpkg --print-architecture).asc" \
|
||||
&& gpg --verify /usr/local/bin/gosu.asc \
|
||||
&& rm /usr/local/bin/gosu.asc \
|
||||
&& chmod +x /usr/local/bin/gosu \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy entrypoint script and Odoo configuration file
|
||||
COPY ./entrypoint.sh /
|
||||
COPY ./openerp-server.conf /etc/odoo/
|
||||
@ -46,8 +57,5 @@ EXPOSE 8069 8071
|
||||
# Set the default config file
|
||||
ENV OPENERP_SERVER /etc/odoo/openerp-server.conf
|
||||
|
||||
# Set default user when running the container
|
||||
USER odoo
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["openerp-server"]
|
||||
|
@ -9,16 +9,25 @@ set -e
|
||||
: ${PGPASSWORD:=$DB_ENV_POSTGRES_PASSWORD}
|
||||
export PGHOST PGPORT PGUSER PGPASSWORD
|
||||
|
||||
if [[ ! -f /var/lib/odoo/etc/openerp-server.conf ]]; then
|
||||
mkdir -p /var/lib/odoo/etc
|
||||
mv /etc/odoo/openerp-server.conf /var/lib/odoo/etc/openerp-server.conf
|
||||
else
|
||||
rm -f /etc/odoo/openerp-server.conf
|
||||
fi
|
||||
ln -s /var/lib/odoo/etc/openerp-server.conf /etc/odoo/openerp-server.conf
|
||||
chown -R odoo /var/lib/odoo
|
||||
|
||||
case "$1" in
|
||||
--)
|
||||
shift
|
||||
exec openerp-server "$@"
|
||||
exec gosu odoo openerp-server "$@"
|
||||
;;
|
||||
-*)
|
||||
exec openerp-server "$@"
|
||||
exec gosu odoo openerp-server "$@"
|
||||
;;
|
||||
*)
|
||||
exec "$@"
|
||||
exec gosu odoo "$@"
|
||||
esac
|
||||
|
||||
exit 1
|
||||
|
Loading…
Reference in New Issue
Block a user