-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathDockerfile
72 lines (67 loc) · 2.59 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
FROM ubuntu:24.04
LABEL maintainer="[email protected]"
ENV PYTHONUNBUFFERED=1
# Installs the base system dependencies for running the site.
# None of this will change with the codebase itself, so this
# whole layer and steps to build it should be cached.
RUN apt-get -y update && \
apt-get install -y \
supervisor \
build-essential \
pkg-config \
python3-dev \
python3-full \
python3-pip \
libmysqlclient-dev \
mysql-client \
libjpeg-dev \
libcurl4-openssl-dev \
curl \
wget \
libpcre3 \
libpcre3-dev \
libssl-dev \
libffi-dev && \
rm -rf /var/lib/apt/lists/* && \
# install nginx + upload module
mkdir -p /tmp/install && \
cd /tmp/install && \
wget http://nginx.org/download/nginx-1.25.3.tar.gz && tar zxf nginx-1.25.3.tar.gz && \
wget https://github.com/fdintino/nginx-upload-module/archive/2.3.0.tar.gz && tar zxf 2.3.0.tar.gz && \
cd /tmp/install/nginx-1.25.3 && \
./configure \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-pcre \
--sbin-path=/usr/sbin/nginx \
--pid-path=/run/nginx.pid \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/srv/mltshp.com/nginx-error.log \
--http-log-path=/srv/mltshp.com/nginx-access.log \
--add-module=/tmp/install/nginx-upload-module-2.3.0 && \
make && make install && \
mkdir -p /etc/nginx && \
rm -rf /tmp/install && \
groupadd mltshp --gid=1010 && \
useradd mltshp --create-home --home-dir=/home/mltshp \
--uid=1010 --gid=1010 && \
mkdir -p /mnt/tmpuploads/0 /mnt/tmpuploads/1 /mnt/tmpuploads/2 \
/mnt/tmpuploads/3 /mnt/tmpuploads/4 /mnt/tmpuploads/5 \
/mnt/tmpuploads/6 /mnt/tmpuploads/7 /mnt/tmpuploads/8 \
/mnt/tmpuploads/9 && \
chmod 777 /mnt/tmpuploads/* && \
mkdir -p /srv/mltshp.com/uploaded /srv/mltshp.com/logs && \
chown -R mltshp:mltshp /srv/mltshp.com
# Install python dependencies which will be cached on the
# contents of requirements.txt:
COPY requirements.txt /tmp
# It's okay to install to the system packages; we're in a container
RUN pip install --break-system-packages -r /tmp/requirements.txt && rm /tmp/requirements.txt
# Copy configuration settings into place
COPY setup/production/supervisord-web.conf /etc/supervisor/conf.d/mltshp.conf
COPY setup/production/nginx.conf /etc/nginx/nginx.conf
# Add "." for the app code itself (also allows for local dev)
ADD . /srv/mltshp.com/mltshp
WORKDIR /srv/mltshp.com/mltshp
EXPOSE 80
CMD ["/usr/bin/supervisord"]