Skip to content

Commit fa8f56d

Browse files
committed
deployment: separate pyproject.toml, poetry.lock, Dockerfil.env for Ubuntu 20.04, 22,04, 24.04
brainframe-cli-2404-build SUCCEEDED, pip install SUCCEEDED on ubuntu-2404-run w/ venv brainframe-cli-2204-build SUCCEEDED, pip install SUCCEEDED on ubuntu-2204-run brainframe-cli-2004-build SUCCEEDED, pip install SUCCEEDED on ubuntu-2004-run brainframe-cli-1804-build FAILED
1 parent a877da3 commit fa8f56d

5 files changed

Lines changed: 1249 additions & 3 deletions

File tree

deployment/Dockerfile.env.py312

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM python:3.12-slim-bullseye
2+
3+
ARG POETRY_VERSION=1.8.3
4+
ARG PYPROJECT
5+
ARG POETRYLOCK
6+
ARG WORKDIR
7+
8+
ENV PYTHONUNBUFFERED=1 \
9+
PYTHONDONTWRITEBYTECODE=1 \
10+
PIP_NO_CACHE_DIR=off \
11+
PIP_DISABLE_PIP_VERSION_CHECK=on \
12+
PIP_DEFAULT_TIMEOUT=100 \
13+
POETRY_HOME="/opt/poetry" \
14+
POETRY_VIRTUALENVS_IN_PROJECT=true \
15+
POETRY_NO_INTERACTION=1 \
16+
PYSETUP_PATH="/opt/pysetup" \
17+
VENV_PATH="/opt/pysetup/.venv"
18+
19+
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
20+
21+
# Install system dependencies
22+
RUN apt-get update \
23+
&& apt-get install -y --no-install-recommends curl \
24+
&& apt-get clean \
25+
&& rm -rf /var/lib/apt/lists/*
26+
27+
# Install Poetry
28+
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION} \
29+
&& chmod a+x /opt/poetry/bin/poetry
30+
31+
# Set working directory
32+
WORKDIR $WORKDIR
33+
34+
# Copy project files
35+
COPY ./deployment/${PYPROJECT} ./pyproject.toml
36+
COPY ./deployment/${POETRYLOCK} ./poetry.lock
37+
38+
# Install project dependencies
39+
RUN poetry lock
40+
RUN poetry install --no-root --with dev
41+
42+
# Set the final working directory
43+
WORKDIR $WORKDIR
44+

deployment/do

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ case $CMD in
7171

7272
brainframe-cli-2404-env-build)
7373
echo ├ ./deployment/do brainframe-cli-2404-env-build # --no-cache
74-
DOCKER_BUILDKIT=1 docker build --file deployment/Dockerfile.env --build-arg WORKDIR=/deployment --build-arg UBUNTU_VERSION=24.04 --build-arg PYPROJECT=pyproject.toml --build-arg POETRYLOCK=poetry.lock $ARGS --tag brainframe-cli-env:2404 .
74+
DOCKER_BUILDKIT=1 docker build --file deployment/Dockerfile.env.py312 --build-arg WORKDIR=/deployment --build-arg UBUNTU_VERSION=24.04 --build-arg PYPROJECT=pyproject.toml.py310.py312 --build-arg POETRYLOCK=poetry.lock.py310.py312 $ARGS --tag brainframe-cli-env:2404 .
7575
;;
7676

7777
brainframe-cli-2404-env-run)
@@ -91,7 +91,7 @@ case $CMD in
9191

9292
brainframe-cli-2204-env-build)
9393
echo ├ ./deployment/do brainframe-cli-2204-env-build # --no-cache
94-
DOCKER_BUILDKIT=1 docker build --file deployment/Dockerfile.env --build-arg WORKDIR=/deployment --build-arg UBUNTU_VERSION=22.04 --build-arg PYPROJECT=pyproject.toml --build-arg POETRYLOCK=poetry.lock $ARGS --tag brainframe-cli-env:2204 .
94+
DOCKER_BUILDKIT=1 docker build --file deployment/Dockerfile.env --build-arg WORKDIR=/deployment --build-arg UBUNTU_VERSION=22.04 --build-arg PYPROJECT=pyproject.toml.py310.py312 --build-arg POETRYLOCK=poetry.lock.py310.py312 $ARGS --tag brainframe-cli-env:2204 .
9595
;;
9696

9797
brainframe-cli-2204-env-run)

0 commit comments

Comments
 (0)