Dockerfile for projects running python3 with pipenv on alpine linux
269
Dockerfile with python3 on alpine linux 3.6 with support for pipenv and
postgres.
The same project runs responder with graphql. This project servers as a host for my Dockerfile and does not contain any useful software.
FROM python:3.6.1-alpine
Inherits from the official alpine python image. This is the lightest container.
RUN apk update && \
apk add \
build-base \
postgresql \
postgresql-dev \
libpq
Updates packages and install dependencies
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
Makes a new directory for the app
COPY ./Pipfile .
COPY ./Pipfile.lock .
Copies the Pipfiles to the app working directory
RUN pip install --upgrade pip && \
pip install pipenv && \
pipenv install --system --deploy
Upgrades pip and deploys pipenv dependencies to system folder. This installation step adds 215 MB as 65 packages.
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
COPY . .
Set environment variables and copies current directory into app working directory.
In a docker-compose.yml file use rayraegah:python3 as image.
Clone this repository and run command docker-compose up -d
Released under MIT License
Content type
Image
Digest
Size
136.6 MB
Last updated
almost 8 years ago
docker pull rayraegah/python3