Would anyone have an example of Dockerfile installing Mayan with Postgres ?

I tried with this and it did not work

NameError: name 'TEMPLATES' is not defined

FROM ubuntu:16.04

MAINTAINER Roberto Rosario "[email protected]"


ENV DEBIAN_FRONTEND noninteractive

ENV MAYAN_USE_POSTGRES True

ENV POSTGRES_DB mayan
ENV POSTGRES_USER mayan
ENV POSTGRES_PASSWORD mayan
ENV POSTGRES_HOST localhost
ENV PORTGRES_PORT 5432

ARG APT_PROXY
# Package caching
RUN if [ "${APT_PROXY}" ]; then echo "Acquire::http { Proxy 
\"http://${APT_PROXY}\";; };" > /etc/apt/apt.conf.d/01proxy; fi

# Install base Ubuntu libraries
RUN apt-get update && \

apt-get install -y --no-install-recommends \
        postgresql \
        libpq-dev \
        gcc \
        ghostscript \
        gpgv \
        libjpeg-dev \
        libmagic1 \
        libpng-dev \
        libpq-dev \
        libreoffice \
        libtiff-dev \
        nginx \
        netcat-openbsd \
        poppler-utils \
        python-dev \
        python-pip \
        python-setuptools \
        python-wheel \
        redis-server \
        supervisor \
        tesseract-ocr \

&& \

apt-get clean autoclean && \

apt-get autoremove -y && \

rm -rf /var/lib/apt/lists/* && \

rm -f /var/cache/apt/archives/*.deb

ENV MAYAN_INSTALL_DIR=/usr/local/lib/python2.7/dist-packages/mayan

# Update to latest version of pip
RUN pip install -U pip

USER postgres
RUN    /etc/init.d/postgresql start &&\
    psql --command "CREATE USER mayan WITH SUPERUSER PASSWORD 'mayan';" && \
    createdb -O mayan mayan;

RUN echo "host all  all    0.0.0.0/0  md5" >> 
/etc/postgresql/9.5/main/pg_hba.conf

RUN echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf

EXPOSE 5432

USER root

# Install Mayan EDMS, latest production release
COPY mayan-edms-2.2.tar.gz /opt/
RUN pip install /opt/mayan-edms-2.2.tar.gz
# RUN pip install mayan-edms==2.2

# Install Python clients for PostgreSQL, REDIS, librabbitmq and uWSGI
RUN pip install psycopg2 redis uwsgi

# Collect static files
RUN mayan-edms.py collectstatic --noinput

# Setup uWSGI
COPY etc/uwsgi/uwsgi.ini $MAYAN_INSTALL_DIR

# Setup NGINX
COPY /etc/nginx/mayan-edms /etc/nginx/sites-available/mayan-edms
RUN rm /etc/nginx/sites-enabled/default
RUN ln -s /etc/nginx/sites-available/mayan-edms 
/etc/nginx/sites-enabled/mayan-edms

# Setup supervisor
COPY /etc/supervisor/beat.conf /etc/supervisor/conf.d
COPY /etc/supervisor/nginx.conf /etc/supervisor/conf.d
COPY /etc/supervisor/uwsgi.conf /etc/supervisor/conf.d
COPY /etc/supervisor/redis.conf /etc/supervisor/conf.d
COPY /etc/supervisor/workers.conf /etc/supervisor/conf.d

# Setup Mayan EDMS settings file overrides
COPY etc/mayan/settings.py /local.py
COPY etc/mayan/postgres.py $MAYAN_INSTALL_DIR/settings/postgres.py

# Create the directory for the logs
RUN mkdir /var/log/mayan

RUN mkdir -p $MAYAN_INSTALL_DIR/media/document_storage/

# Fix ownership
RUN chown -R www-data:www-data $MAYAN_INSTALL_DIR

# Make volume symlinks
RUN ln -s $MAYAN_INSTALL_DIR/media /var/lib/mayan
RUN ln -s $MAYAN_INSTALL_DIR/settings /etc/mayan
RUN chown www-data:www-data /var/lib/mayan
RUN chown www-data:www-data /etc/mayan

#TESTES
RUN    /etc/init.d/postgresql start && \
       mayan-edms.py initialsetup
RUN cat /local.py >> 
/usr/local/lib/python2.7/dist-packages/mayan/settings/local.py
RUN chown -R www-data:www-data /usr/local/lib/python2.7/dist-packages/mayan/

VOLUME ["/etc/mayan", "/var/lib/mayan"]
VOLUME  ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]

COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
CMD ["mayan:start"]

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Mayan EDMS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to