-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b232a30
commit c731896
Showing
47 changed files
with
2,146 additions
and
1,976 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
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# ----------------- STAGE 1 ----------------- | ||
FROM python:3.13-slim-bookworm as base | ||
# using slim for development as the wheels are not always compat with | ||
# alpine, and builds can be slow as a result | ||
# FROM python:3.12-slim as base | ||
|
||
ARG DEV=false | ||
ENV VIRTUAL_ENV=/app/docker_venv \ | ||
PATH="/app/docker_venv/bin:$PATH" | ||
|
||
# ----------------- STAGE 2 ----------------- | ||
FROM base as builder | ||
WORKDIR /app | ||
|
||
# Mostly config for poetry | ||
# - disable prompting | ||
# - disable virtualenv creation | ||
# - specify the path to the venv | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=0 \ | ||
POETRY_VIRTUALENVS_CREATE=0 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache \ | ||
VIRTUAL_ENV=/app/docker_venv \ | ||
PATH="/app/docker_venv/bin:$PATH" | ||
|
||
# install build tools, and dev libs required to compile postgres stuff | ||
# ideally these are not going to be used as for most of the libs | ||
# there are wheels available, however they are available in case we | ||
# need to compile something | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends gcc libpq-dev python3-dev && \ | ||
useradd -M nonroot | ||
|
||
# Install Poetry to global python env | ||
RUN pip install poetry==1.8.4 | ||
|
||
# Grab the app dependency declarations | ||
COPY ./data_prep/pyproject.toml ./data_prep/poetry.lock /app/ | ||
|
||
# create the venv in $VIRTUAL_ENV so we can control where it is being created | ||
# unfortunately this is the only way that we can control the venv that | ||
# poetry will use, is to create it ourselves | ||
RUN python -m venv $VIRTUAL_ENV; . $VIRTUAL_ENV/bin/activate | ||
|
||
# have created and activated the venv, now install the dependencies into it | ||
RUN poetry install --without dev --no-root -v && rm -rf $POETRY_CACHE_DIR | ||
|
||
# ----------------- STAGE 3 ----------------- | ||
FROM base as runtime | ||
WORKDIR /app | ||
|
||
# install the postgres client, required by psycopg2 | ||
RUN apt update && apt install -y --no-install-recommends postgresql-client | ||
|
||
# only copy over the venv from the builder stage | ||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
# RUN apk add bash | ||
COPY data_prep/db_env_utils/ /app/db_env_utils/ | ||
COPY docker-compose.yml /app/ | ||
|
||
CMD ["python", "db_env_utils/main_ora_ingest.py", "TEST"] |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# ----------------- STAGE 1 ----------------- | ||
# NEEDS the docker-compose file to retrieve the local database connection | ||
# information. To be able to include the docker-compose in the build this | ||
# dockerfile needs to be located in the parent directory of the docker-compose | ||
FROM python:3.13-slim-bookworm as base | ||
# using slim for development as the wheels are not always compat with | ||
# alpine, and builds can be slow as a result | ||
# FROM python:3.12-slim as base | ||
|
||
ARG DEV=false | ||
ENV VIRTUAL_ENV=/app/docker_venv \ | ||
PATH="/app/docker_venv/bin:$PATH" | ||
|
||
# ----------------- STAGE 2 ----------------- | ||
FROM base as builder | ||
WORKDIR /app | ||
|
||
# Mostly config for poetry | ||
# - disable prompting | ||
# - disable virtualenv creation | ||
# - specify the path to the venv | ||
ENV POETRY_NO_INTERACTION=1 \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=0 \ | ||
POETRY_VIRTUALENVS_CREATE=0 \ | ||
POETRY_CACHE_DIR=/tmp/poetry_cache \ | ||
VIRTUAL_ENV=/app/docker_venv \ | ||
PATH="/app/docker_venv/bin:$PATH" | ||
|
||
# install build tools, and dev libs required to compile postgres stuff | ||
# ideally these are not going to be used as for most of the libs | ||
# there are wheels available, however they are available in case we | ||
# need to compile something | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends gcc libpq-dev python3-dev && \ | ||
useradd -M nonroot | ||
|
||
# Install Poetry to global python env | ||
RUN pip install poetry==1.8.4 | ||
|
||
# Grab the app dependency declarations | ||
COPY ./data_prep/pyproject.toml data_prep/poetry.lock /app/ | ||
|
||
# create the venv in $VIRTUAL_ENV so we can control where it is being created | ||
# unfortunately this is the only way that we can control the venv that | ||
# poetry will use, is to create it ourselves | ||
RUN python -m venv $VIRTUAL_ENV; . $VIRTUAL_ENV/bin/activate | ||
|
||
# have created and activated the venv, now install the dependencies into it | ||
RUN poetry install --without dev --no-root -v && rm -rf $POETRY_CACHE_DIR | ||
|
||
# ----------------- STAGE 3 ----------------- | ||
FROM base as runtime | ||
WORKDIR /app | ||
|
||
|
||
# install the postgres client, required by psycopg2 | ||
RUN apt update && apt install -y --no-install-recommends postgresql-client | ||
|
||
# only copy over the venv from the builder stage | ||
COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} | ||
|
||
# RUN apk add bash | ||
COPY data_prep/db_env_utils/ /app/db_env_utils/ | ||
COPY docker-compose.yml /app/ | ||
|
||
CMD ["python", "db_env_utils/main_spar_ingest.py", "TEST"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Demo code to help get started with working with oracle in a container. | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.