-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
43 lines (31 loc) · 1.4 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM logicify/centos7
MAINTAINER "Dmitry Berezovsky <[email protected]>"
ENV APPLICATION_DIR="/srv/application"
# Install required packages
RUN yum update -y; yum clean all
RUN yum-builddep -y python; yum -y install make postgresql-devel gcc \
libtiff-devel libjpeg-devel libzip-devel freetype-devel lcms2-devel libwebp-devel tcl-devel tk-devel \
libxslt-devel libxml2-devel python-devel; yum clean all
ENV PYTHON_VERSION="3.5.6"
# Downloading and building python
RUN mkdir /tmp/python-build && cd /tmp/python-build && \
curl https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tgz > python.tgz && \
tar xzf python.tgz && cd Python-$PYTHON_VERSION && \
./configure --prefix=/usr/local --enable-shared && make install && cd / && rm -rf /tmp/python-build
# Install locale
RUN localedef -v -c -i en_US -f UTF-8 en_US.UTF-8 || true
ENV LC_ALL "en_US.UTF-8"
ENV LD_LIBRARY_PATH "$LD_LIBRARY_PATH:/usr/local/lib"
# install virtualenv
RUN pip3 install virtualenv
# Create virtual environment
RUN cd /srv \
&& virtualenv --python=python3 virtenv \
&& chown -R app:app /srv/virtenv
RUN mkdir $APPLICATION_DIR && chown -R app:app $APPLICATION_DIR && cd $APPLICATION_DIR
USER app
WORKDIR $APPLICATION_DIR
RUN echo "source /srv/virtenv/bin/activate" >> "/home/app/.bashrc" \
&& echo "export LANG=en_US.UTF-8" >> /home/app/.bashrc
CMD ["/bin/bash"]
VOLUME ["$APPLICATION_DIR"]