Used alpine as a based image

This commit is contained in:
2022-08-05 12:41:23 +03:00
parent 7ae9de7c6c
commit 80c9dc8f0f
2 changed files with 8 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
FROM python:3.10-slim-bullseye FROM alpine:3.16
ENV HOME=/home/app \ ENV HOME=/home/app \
APP_HOME=/home/app/docker-postgres-backup \ APP_HOME=/home/app/docker-postgres-backup \
@@ -18,15 +18,13 @@ ENV HOME=/home/app \
LANGUAGE=en_US:en \ LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends locales postgresql-client-13 tini && \ RUN apk --no-cache add postgresql13-client python3 py3-pip tini
apt-get -y --purge autoremove && apt-get clean && rm -rf /var/cache/apt && \
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen && pip install -U pip
COPY ./ $APP_HOME COPY ./ $APP_HOME
WORKDIR $APP_HOME WORKDIR $APP_HOME
RUN python -m pip install $APP_HOME RUN python3 -m pip install $APP_HOME
ENTRYPOINT ["tini", "--"] ENTRYPOINT ["tini", "--"]
CMD ["python", "start.py"] CMD ["python3", "start.py"]

View File

@@ -1,4 +1,4 @@
FROM python:3.10-slim-bullseye FROM alpine:3.16
ENV HOME=/home/app \ ENV HOME=/home/app \
APP_HOME=/home/app/docker-postgres-backup \ APP_HOME=/home/app/docker-postgres-backup \
@@ -18,18 +18,13 @@ ENV HOME=/home/app \
LANGUAGE=en_US:en \ LANGUAGE=en_US:en \
LC_ALL=en_US.UTF-8 LC_ALL=en_US.UTF-8
RUN apt-get update && apt-get install -y --no-install-recommends locales curl ca-certificates gnupg tini && \ RUN apk --no-cache add postgresql14-client python3 py3-pip tini
curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor | tee /etc/apt/trusted.gpg.d/apt.postgresql.org.gpg >/dev/null && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && \
apt-get update && apt-get -y --no-install-recommends install postgresql-client-14 && \
apt-get -y --purge autoremove && apt-get clean && rm -rf /var/cache/apt && \
sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen && pip install -U pip
COPY ./ $APP_HOME COPY ./ $APP_HOME
WORKDIR $APP_HOME WORKDIR $APP_HOME
RUN python -m pip install $APP_HOME RUN python3 -m pip install $APP_HOME
ENTRYPOINT ["tini", "--"] ENTRYPOINT ["tini", "--"]
CMD ["python", "start.py"] CMD ["python3", "start.py"]