-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9190a6c
commit a38ae8e
Showing
1 changed file
with
21 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,37 @@ | ||
# Here is the build image | ||
FROM python:3.8.0-slim as builder | ||
RUN apt-get update \ | ||
&& apt-get install gcc libpq-dev python-dev -y \ | ||
&& apt-get clean | ||
RUN python -m venv /opt/venv | ||
FROM ubuntu:20.04 as builder | ||
|
||
ENV DEBIAN_FRONTEND="noninteractive" | ||
ENV TZ="Etc/UTC" | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y python3.9 python3.9-dev python3.9-venv python3-pip python3-wheel build-essential && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN python3.9 -m venv /opt/venv | ||
# Make sure we use the virtualenv: | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
RUN pip install vwsfriend | ||
RUN pip3 install --no-cache-dir wheel | ||
RUN pip3 install --no-cache-dir vwsfriend | ||
|
||
FROM python:3.9.6-slim-buster | ||
#RUN python setup.py install | ||
|
||
FROM ubuntu:20.04 AS runner-image | ||
|
||
ENV WECONNECT_USER= | ||
ENV WECONNECT_PASSWORD= | ||
ENV WECONNECT_INTERVAL= | ||
ENV ADDITIONAL_PARAMETERS= | ||
ENV DATABASE_URL= | ||
|
||
RUN apt-get update && apt-get install --no-install-recommends -y python3.9 python3-venv && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /opt/venv /opt/venv | ||
ENV VIRTUAL_ENV=/opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
RUN mkdir -p /config | ||
|
||
# make sure all messages always reach console | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
CMD vwsfriend --username ${WECONNECT_USER} --password ${WECONNECT_PASSWORD} --interval ${WECONNECT_INTERVAL} --database-url ${DATABASE_URL} --config-dir /config ${ADDITIONAL_PARAMETERS} |