Skip to content

Commit

Permalink
hopefully smaller and faster docker builds
Browse files Browse the repository at this point in the history
  • Loading branch information
rchan26 committed Jun 13, 2024
1 parent c27b396 commit 55c9f3d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 17 deletions.
18 changes: 13 additions & 5 deletions docker/create_index/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM python:3.11.4
FROM python:3.11.9

WORKDIR /app

# Setup Python prerequisites
RUN pip3 install --upgrade pip poetry setuptools wheel
RUN pip3 install --upgrade pip poetry==1.8.3 setuptools wheel

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Build Python project
COPY reginald reginald
COPY pyproject.toml .
COPY README.md .
RUN poetry install
RUN touch README.md
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR

COPY reginald reginald

RUN poetry install --without dev

CMD ["poetry", "run", "reginald", "create-index"]
16 changes: 12 additions & 4 deletions docker/reginald_app/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM python:3.11.4
FROM python:3.11.9

WORKDIR /app

# Setup Python prerequisites
RUN pip3 install --upgrade pip poetry setuptools wheel

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Build Python project
COPY reginald reginald
COPY pyproject.toml .
COPY README.md .
RUN poetry install --extras api_bot
RUN touch README.md
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR

COPY reginald reginald

RUN poetry install --extras api_bot --without dev

CMD ["poetry", "run", "reginald", "app"]
16 changes: 12 additions & 4 deletions docker/run_all/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM python:3.11.4
FROM python:3.11.9

WORKDIR /app

# Setup Python prerequisites
RUN pip3 install --upgrade pip poetry setuptools wheel

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Build Python project
COPY reginald reginald
COPY pyproject.toml .
COPY README.md .
RUN poetry install
RUN touch README.md
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR

COPY reginald reginald

RUN poetry install --without dev

CMD ["poetry", "run", "reginald", "run-all"]
16 changes: 12 additions & 4 deletions docker/slack_bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
FROM python:3.11.4
FROM python:3.11.9

WORKDIR /app

# Setup Python prerequisites
RUN pip3 install --upgrade pip poetry setuptools wheel

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache

# Build Python project
COPY reginald reginald
COPY pyproject.toml .
COPY README.md .
RUN poetry install --extras api_bot
RUN touch README.md
RUN poetry install --without dev --no-root && rm -rf $POETRY_CACHE_DIR

COPY reginald reginald

RUN poetry install --extras api_bot --without dev

CMD ["poetry", "run", "reginald", "bot"]

0 comments on commit 55c9f3d

Please sign in to comment.