-
Notifications
You must be signed in to change notification settings - Fork 154
/
Copy pathDockerfile
57 lines (48 loc) · 1.31 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
FROM ubuntu:22.04
LABEL maintainer=falldog
ARG PY_VER=3.10
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
# debug utility
vim \
less \
\
curl \
build-essential \
software-properties-common \
python3-distutils \
\
&& rm -rf /var/lib/apt/lists/*
RUN set -ex \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
python${PY_VER} python${PY_VER}-dev \
\
&& rm -rf /var/lib/apt/lists/* \
\
&& curl https://bootstrap.pypa.io/get-pip.py | python${PY_VER}
RUN set -ex \
&& mkdir -p /code \
&& mkdir -p /pyconcrete-code \
&& ln -sf /usr/bin/python${PY_VER} /usr/bin/python
# install pip requirements
COPY example/django/pye_web/requirements.txt /code/
RUN pip install --no-cache-dir -r /code/requirements.txt
# copy source code
COPY example/django/pye_web/ \
/code/
COPY . \
/pyconcrete-code/
# install pyconcrete && compile .pye
RUN set -ex \
&& cd /pyconcrete-code/ \
&& python setup.py install --passphrase=PASSPHARE \
&& pyconcrete-admin.py compile \
--source=/code/ \
--pye \
--remove-py \
--remove-pyc \
-i wsgi.py manage.py
WORKDIR /code
CMD ["python", "manage.py", "runserver", "0.0.0.0:80"]