FROM registry.yaltik.net/frappe:yaltik
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>

# Frappe production setup

RUN python install.py --production --user $FRAPPE_USER --mysql-root-password $MYSQL_PASSWORD --admin-password $ADMIN_PASSWORD

# Supervisor configuration
COPY production.conf /etc/supervisor/conf.d/
# Cleanup
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/

# Frappe local production setup
USER frappe
WORKDIR /home/$FRAPPE_USER/frappe-bench
RUN bench setup production

# Default ports
EXPOSE 80 25

# Default command
CMD ["/usr/bin/supervisord","-n"]
