-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile.source
More file actions
35 lines (27 loc) · 839 Bytes
/
dockerfile.source
File metadata and controls
35 lines (27 loc) · 839 Bytes
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
ARG PYTHON=3.6.12
ARG FLAVOR=buster
FROM python:${PYTHON}-slim-${FLAVOR} AS base-source
RUN mkdir -p /workspace
COPY dependencies.txt /workspace/
COPY resolver.py /workspace/
RUN apt-get update && \
apt-get install -y build-essential git && \
pip install -r /workspace/dependencies.txt
WORKDIR /workspace
RUN git clone https://github.com/aio-libs/aiohttp.git
FROM base-source as base
ARG COMMIT
WORKDIR /workspace/aiohttp
RUN echo "Fetch commit $COMMIT" && \
git reset --hard $COMMIT && \
git submodule update --init && \
pip install .
RUN apt-get remove -y --purge build-essential && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*
EXPOSE 80
FROM base AS server
WORKDIR /workspace
RUN rm -rf /workspace/aiohttp
COPY server.py /workspace/
ENTRYPOINT ["/usr/local/bin/python3", "server.py"]