-
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.
Simplify docker image building process
- Loading branch information
Showing
4 changed files
with
19 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,14 +146,6 @@ jobs: | |
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Setup Poetry | ||
uses: abatilo/[email protected] | ||
with: | ||
poetry-version: ${{ env.POETRY_VERSION }} | ||
|
||
- name: Export requirements.txt | ||
run: poetry export -E all -f requirements.txt --output requirements.txt | ||
|
||
- name: Login to Docker Hub | ||
uses: docker/login-action@v1 | ||
with: | ||
|
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,20 +1,27 @@ | ||
FROM python:3.8-slim AS base | ||
|
||
FROM python:3.8-slim | ||
# Builder - Dependencies | ||
FROM base AS builder | ||
|
||
RUN apt-get clean | ||
RUN apt-get update | ||
RUN apt-get install -y git build-essential libsasl2-dev | ||
RUN pip install poetry | ||
|
||
COPY ./requirements.txt /src/requirements.txt | ||
COPY pyproject.toml poetry.lock src/ | ||
WORKDIR /src | ||
|
||
RUN pip install -r /src/requirements.txt --no-deps | ||
RUN poetry export --all-extras --format=requirements.txt --output=requirements.txt | ||
|
||
RUN rm -rf /src | ||
# Runtime | ||
FROM base AS runtime | ||
|
||
COPY . /src | ||
RUN apt-get clean | ||
RUN apt-get update | ||
RUN apt-get install -y git build-essential libsasl2-dev | ||
|
||
RUN pip install '/src[all]' | ||
COPY --from=builder /src/requirements.txt /dep/requirements.txt | ||
RUN pip install -r /dep/requirements.txt --no-deps | ||
|
||
COPY . src/ | ||
RUN pip install '/src[all]' | ||
RUN rm -rf /src | ||
|
||
CMD ["sh", "-c", "metaphor ${CONNECTOR} ${CONFIG_FILE}"] |
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,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "metaphor-connectors" | ||
version = "0.14.78" | ||
version = "0.14.79" | ||
license = "Apache-2.0" | ||
description = "A collection of Python-based 'connectors' that extract metadata from various sources to ingest into the Metaphor app." | ||
authors = ["Metaphor <[email protected]>"] | ||
|