Skip to content

Commit

Permalink
Fix/dockerfile (#322)
Browse files Browse the repository at this point in the history
* Test PR changes

* Modify dockerfile

* Fix dockerfile and docker-entrypoint

* Remove REQUESTS_VERSION from dockerfile

* Update docker-entrypoint name in dockerfile

* Adjust docker-entrypoint

* Adjust docker-entrypoint command in the dockerfile
  • Loading branch information
nataliaweni authored and helllllllder committed Jan 11, 2024
1 parent 8ef32ef commit 1d89757
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ ARG PYTHON_VERSION="3.9"
ARG POETRY_VERSION="1.1.15"

ARG BUILD_DEPS="\
python3-dev \
build-essential \
gettext \
libpq-dev \
cmake \
pkg-config \
autoconf \
libtool \
automake"
python3-dev \
build-essential \
gettext \
libpq-dev \
cmake \
pkg-config \
autoconf \
libtool \
automake"

ARG RUNTIME_DEPS="\
tzdata \
curl \
gosu \
gettext \
postgresql-client \
ffmpeg \
libmagic1"
tzdata \
curl \
gosu \
gettext \
postgresql-client \
ffmpeg \
libmagic1"

FROM python:${PYTHON_VERSION}-slim as base

Expand All @@ -32,28 +32,28 @@ ARG APP_VERSION="0.1"

# set environment variables
ENV APP_VERSION=${APP_VERSION} \
RUNTIME_DEPS=${RUNTIME_DEPS} \
BUILD_DEPS=${BUILD_DEPS} \
APPLICATION_NAME="Chats" \
PROJECT_PATH=/chats \
PROJECT_USER=app_user \
PROJECT_GROUP=app_group \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PATH="/install/bin:${PATH}" \
APP_PORT=${APP_PORT}
RUNTIME_DEPS=${RUNTIME_DEPS} \
BUILD_DEPS=${BUILD_DEPS} \
APPLICATION_NAME="Chats" \
PROJECT_PATH=/chats \
PROJECT_USER=app_user \
PROJECT_GROUP=app_group \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONIOENCODING=UTF-8 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PATH="/install/bin:${PATH}" \
APP_PORT=${APP_PORT}

LABEL app=${VERSION} \
os="debian" \
os.version="10" \
name="${APPLICATION_NAME} ${APP_VERSION}" \
description="${APPLICATION_NAME} image" \
maintainer="${APPLICATION_NAME} Team"
os="debian" \
os.version="10" \
name="${APPLICATION_NAME} ${APP_VERSION}" \
description="${APPLICATION_NAME} image" \
maintainer="${APPLICATION_NAME} Team"

RUN addgroup --gid 1999 "${PROJECT_GROUP}" \
&& useradd --system -m -d ${PROJECT_PATH} -u 1999 -g 1999 "${PROJECT_USER}"
&& useradd --system -m -d ${PROJECT_PATH} -u 1999 -g 1999 "${PROJECT_USER}"

# set work directory
WORKDIR ${PROJECT_PATH}
Expand All @@ -78,7 +78,7 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y ${BUILD_DEPS}

COPY --from=build-poetry "${PROJECT_PATH}/requirements.txt" /tmp/dep/
RUN --mount=type=cache,mode=0755,target=/pip_cache,id=pip pip install --cache-dir /pip_cache --prefix=/install -r /tmp/dep/requirements.txt

Expand Down

0 comments on commit 1d89757

Please sign in to comment.