-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (25 loc) · 910 Bytes
/
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
FROM python:3.10.2-slim-buster AS compiler
RUN apt clean \
&& apt update -y \
&& apt install nginx python3-dev build-essential --no-install-recommends -y
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY s3-bucket-exposer/requirements.txt requirements.txt
RUN pip install -r requirements.txt
FROM python:3.10.2-slim-buster AS app
COPY --from=compiler /opt/venv /opt/venv
RUN apt clean \
&& apt update -y \
&& apt install nginx --no-install-recommends -y \
&& rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man \
&& apt clean
COPY s3-bucket-exposer /srv/s3-bucket-exposer
COPY container/uwsgi.ini /srv/s3-bucket-exposer
COPY container/run.sh /srv/s3-bucket-exposer
WORKDIR /srv/s3-bucket-exposer
ARG FLASK_ENV="production"
ENV PATH="/opt/venv/bin:$PATH"
ENV PYTHONUNBUFFERED="true"
COPY container/nginx.conf /etc/nginx
RUN chmod +x ./run.sh
CMD ["./run.sh"]