-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: updated dockerfile & docker-compose
- Loading branch information
Showing
4 changed files
with
51 additions
and
26 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
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,26 +1,28 @@ | ||
FROM python:3.10-slim as builder | ||
|
||
WORKDIR /usr/src/app | ||
COPY ./requirements.txt ./ | ||
RUN apt-get update && apt-get install -y --no-install-recommends build-essential \ | ||
&& pip install --no-cache-dir --prefix=/usr/src/app/dist -r requirements.txt \ | ||
&& apt-get purge -y --auto-remove build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
|
||
FROM python:3.10-slim | ||
LABEL maintainer="[email protected]" | ||
LABEL name="tools/tracker-exporter" | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV TZ=Europe/Moscow | ||
COPY --from=builder /usr/src/app/dist /usr/local | ||
WORKDIR /opt/exporter | ||
|
||
# Prepare environment & packages | ||
RUN apt-get -qq update && \ | ||
apt-get install -yqq tzdata && \ | ||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ | ||
COPY . . | ||
RUN pip install --no-cache-dir . | ||
RUN rm -rf /opt/exporter | ||
|
||
ENV TZ=Europe/Moscow | ||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \ | ||
echo $TZ > /etc/timezone && \ | ||
dpkg-reconfigure -f noninteractive tzdata && \ | ||
apt-get clean && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends tzdata && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Configure exporter | ||
RUN mkdir -p /opt/exporter | ||
COPY ./requirements.txt requirements.txt | ||
COPY . /opt/exporter/ | ||
|
||
# Install exporter | ||
WORKDIR /opt/exporter | ||
RUN python3 setup.py install | ||
|
||
CMD ["tracker-exporter"] |
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
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