Browse Source

Add multi stage builds

docker
Luke Childs 4 years ago
parent
commit
9d7c6c31f9
  1. 12
      Dockerfile

12
Dockerfile

@ -1,4 +1,5 @@
FROM python:3.7-slim
# Build image
FROM python:3.7-slim as builder
WORKDIR /app
@ -16,6 +17,15 @@ RUN pip install pipenv
COPY Pipfile* /app/
RUN pipenv install --dev
# Production image
FROM python:3.7-slim as lnbits
WORKDIR /app
ENV VIRTUAL_ENV=/opt/venv
COPY --from=builder $VIRTUAL_ENV $VIRTUAL_ENV
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
# Copy in app source
COPY . /app

Loading…
Cancel
Save