2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2025-01-26 16:48:25 +00:00

61 lines
1.8 KiB
Docker
Raw Normal View History

2020-06-27 23:44:13 +05:30
FROM bitnami/python:3.7-prod
2020-02-10 13:30:54 +05:30
RUN useradd -ms /bin/bash frappe
2020-06-27 23:44:13 +05:30
ARG GIT_BRANCH=develop
ENV PYTHONUNBUFFERED 1
2020-06-27 23:44:13 +05:30
# Install dependencies
2020-02-10 13:30:54 +05:30
WORKDIR /home/frappe/frappe-bench
RUN install_packages \
git \
mariadb-client \
2020-06-27 23:44:13 +05:30
postgresql-client \
2020-02-10 13:30:54 +05:30
gettext-base \
wget \
# for PDF
2020-06-27 23:44:13 +05:30
libjpeg62-turbo \
libx11-6 \
libxcb1 \
libxext6 \
libxrender1 \
2020-02-10 13:30:54 +05:30
libssl-dev \
fonts-cantarell \
xfonts-75dpi \
xfonts-base \
# For psycopg2
libpq-dev \
2020-06-27 23:44:13 +05:30
&& wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb \
&& dpkg -i wkhtmltox_0.12.5-1.buster_amd64.deb && rm wkhtmltox_0.12.5-1.buster_amd64.deb \
&& apt-get purge -y wget && apt-get autoremove -y
2020-02-10 13:30:54 +05:30
2020-06-27 23:44:13 +05:30
# Create frappe-bench directories
RUN mkdir -p apps logs commands /home/frappe/backups
2020-02-10 13:30:54 +05:30
2020-06-27 23:44:13 +05:30
# Setup python environment
RUN python -m venv env \
2020-02-10 13:30:54 +05:30
&& . env/bin/activate \
&& cd apps \
2020-06-27 23:44:13 +05:30
&& git clone --depth 1 -o upstream https://github.com/frappe/frappe --branch ${GIT_BRANCH} \
&& pip3 install --no-cache-dir -e /home/frappe/frappe-bench/apps/frappe
2020-02-10 13:30:54 +05:30
2020-06-27 23:44:13 +05:30
# Copy scripts and templates
COPY build/common/commands/* /home/frappe/frappe-bench/commands/
COPY build/common/common_site_config.json.template /opt/frappe/common_site_config.json.template
2020-06-27 23:44:13 +05:30
COPY build/common/worker/install_app.sh /usr/local/bin/install_app
2020-02-10 13:30:54 +05:30
# Setup docker-entrypoint
COPY build/common/worker/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
2020-02-10 13:30:54 +05:30
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
2020-06-27 23:44:13 +05:30
# Use sites volume as working directory
2020-02-10 13:30:54 +05:30
WORKDIR /home/frappe/frappe-bench/sites
2020-06-27 23:44:13 +05:30
# Set ownership of sites directory
RUN chown -R frappe:frappe /home/frappe/frappe-bench/sites /home/frappe/backups
VOLUME [ "/home/frappe/frappe-bench/sites", "/home/frappe/backups" ]
2020-02-10 13:30:54 +05:30
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["start"]