|
1 |
| -FROM airbyte/integration-base-python:0.1.1 |
| 1 | +FROM python:3.7.11-alpine3.14 as base |
2 | 2 |
|
3 |
| -# Bash is installed for more convenient debugging. |
4 |
| -RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/* |
| 3 | +# build and load all requirements |
| 4 | +FROM base as builder |
| 5 | +WORKDIR /airbyte/integration_code |
| 6 | + |
| 7 | +# upgrade pip to the latest version |
| 8 | +RUN apk --no-cache upgrade \ |
| 9 | + && pip install --upgrade pip \ |
| 10 | + && apk --no-cache add tzdata build-base libffi-dev |
5 | 11 |
|
6 |
| -ENV CODE_PATH="source_microsoft_teams" |
7 |
| -ENV AIRBYTE_IMPL_MODULE="source_microsoft_teams" |
8 |
| -ENV AIRBYTE_IMPL_PATH="SourceMicrosoftTeams" |
9 | 12 |
|
10 |
| -WORKDIR /airbyte/integration_code |
11 |
| -COPY $CODE_PATH ./$CODE_PATH |
12 | 13 | COPY setup.py ./
|
13 |
| -RUN pip install . |
| 14 | +# install necessary packages to a temporary folder |
| 15 | +RUN pip install --prefix=/install . |
| 16 | + |
| 17 | +# build a clean environment |
| 18 | +FROM base |
| 19 | +WORKDIR /airbyte/integration_code |
| 20 | + |
| 21 | +# copy all loaded and built libraries to a pure basic image |
| 22 | +COPY --from=builder /install /usr/local |
| 23 | +# add default timezone settings |
| 24 | +COPY --from=builder /usr/share/zoneinfo/Etc/UTC /etc/localtime |
| 25 | +RUN echo "Etc/UTC" > /etc/timezone |
| 26 | + |
| 27 | +# bash is installed for more convenient debugging. |
| 28 | +RUN apk --no-cache add bash |
| 29 | + |
| 30 | +# copy payload code only |
| 31 | +COPY main.py ./ |
| 32 | +COPY source_microsoft_teams ./source_microsoft_teams |
14 | 33 |
|
15 |
| -ENV AIRBYTE_ENTRYPOINT "/airbyte/base.sh" |
| 34 | +ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py" |
| 35 | +ENTRYPOINT ["python", "/airbyte/integration_code/main.py"] |
16 | 36 |
|
17 |
| -LABEL io.airbyte.version=0.2.2 |
| 37 | +LABEL io.airbyte.version=0.2.3 |
18 | 38 | LABEL io.airbyte.name=airbyte/source-microsoft-teams
|
0 commit comments