Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,43 @@
FROM python:3.10-alpine
FROM python:3.10-alpine AS builder

ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/bootstrap-service
ENV DJANGO_SETTINGS_MODULE=bootstrap_service.settings

RUN apk add --no-cache \
build-base \
libffi-dev \
curl \
bash \
netcat-openbsd \
git

# Install private repo using BuildKit secret
WORKDIR /install

# install private repo
RUN --mount=type=secret,id=github_token \
pip install --no-cache-dir \
pip install --no-cache-dir --prefix=/install \
git+https://$(cat /run/secrets/github_token)@github.com/Space-DF/django-common-utils.git@dev

# install python requirements
COPY requirements.txt .
RUN pip install --no-cache-dir --prefix=/install -r requirements.txt

FROM python:3.10-alpine

ENV PYTHONUNBUFFERED=1
ENV PYTHONPATH=/bootstrap-service
ENV DJANGO_SETTINGS_MODULE=bootstrap_service.settings

RUN apk add --no-cache \
curl \
bash \
netcat-openbsd \
libffi

WORKDIR /app

# copy only installed python packages
COPY --from=builder /install /usr/local

# copy source code
COPY . .
RUN pip install -r requirements.txt

RUN ["chmod", "+x", "./docker-entrypoint.sh"]

Expand Down
Loading