-
Notifications
You must be signed in to change notification settings - Fork 44
/
Containerfile
45 lines (32 loc) · 1.05 KB
/
Containerfile
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
FROM registry.fedoraproject.org/fedora-minimal:38 AS base
RUN \
microdnf install -y \
python3-pip && \
microdnf clean all
WORKDIR /usr/app
RUN python3 -m venv venv
RUN venv/bin/pip install -U pip
COPY requirements.txt /usr/app/requirements.txt
RUN venv/bin/pip install -r requirements.txt
# Copy the source code in last to optimise rebuilding the image
COPY src/pinnwand /usr/app/pinnwand
EXPOSE 8000
CMD ["venv/bin/python3", "-m", "pinnwand", "http"]
# =========================================================================
FROM base AS psql
WORKDIR /usr/app
COPY --from=base /usr/app ./
RUN venv/bin/pip install psycopg2-binary
EXPOSE 8000
CMD ["venv/bin/python3", "-m", "pinnwand", "http"]
# =========================================================================
FROM base AS mysql
WORKDIR /usr/app
RUN \
microdnf install -y \
community-mysql-devel python3-devel gcc && \
microdnf clean all
COPY --from=base /usr/app ./
RUN venv/bin/pip install mysqlclient
EXPOSE 8000
CMD ["venv/bin/python3", "-m", "pinnwand", "http"]