-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile-localstack
More file actions
32 lines (24 loc) · 1.09 KB
/
Dockerfile-localstack
File metadata and controls
32 lines (24 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## ----------------------------------------------------------------------------
## Base stage for python development
## ----------------------------------------------------------------------------
FROM --platform=linux/amd64 localstack/localstack:latest AS base
ENV VIRTUAL_ENV=/opt/venv
RUN python3 -m venv $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# EMR 6.x uses Python 3.7 - limit Poetry version to 1.5.1
ENV POETRY_VERSION=1.5.1
RUN python3 -m pip install --upgrade pip
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="$PATH:/root/.local/bin"
WORKDIR /app
COPY . .
## ----------------------------------------------------------------------------
## Build and export stages for standard Python projects
## ----------------------------------------------------------------------------
# Build stage - installs required dependencies and creates a venv package
FROM base AS build-poetry
WORKDIR /app
RUN poetry self add poetry-plugin-bundle@1.4.1
RUN poetry bundle venv /app/dist/bundle --clear
FROM scratch AS export-poetry
COPY --from=build-poetry /app/dist/bundle /pyspark_env/