Last active
May 16, 2023 17:58
-
-
Save eriktelepovsky/394cfb8c972c20b14642c9e16232bc53 to your computer and use it in GitHub Desktop.
Django project Docker
This file contains hidden or 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
docker image build -f Dockerfile-python3 --platform linux/amd64 -t django_project . | |
docker image tag django_project pragmaticcode/django_project:python3.9.9-slim-bullseye-node16 | |
docker push pragmaticcode/django_project:python3.9.9-slim-bullseye-node16 | |
docker image build -f Dockerfile-python3 --platform linux/amd64 -t django_project . | |
docker image tag django_project pragmaticcode/django_project:python3.9.5-slim-buster-node16 | |
docker push pragmaticcode/django_project:python3.9.5-slim-buster-node16 | |
docker image build -f Dockerfile-python2 --platform linux/amd64 -t django_project . | |
docker image tag django_project pragmaticcode/django_project:python2.7.18-slim-stretch | |
docker push pragmaticcode/django_project:python2.7.18-slim-stretch |
This file contains hidden or 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
# Use an official Python runtime as a parent image | |
FROM python:2.7.18-slim-buster | |
# output into stdout | |
ENV PYTHONUNBUFFERED 1 | |
# install wget and its dependencies | |
RUN apt-get update | |
RUN apt-get install -y build-essential | |
RUN apt-get install -y gnupg2 | |
RUN apt-get install -y sudo wget curl htop vim | |
# Latest PostgreSQL Prerequsities | |
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - | |
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
# RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
# RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
# install system packages | |
RUN apt-get update | |
# download dependencies | |
# RUN wget https://gist.githubusercontent.com/eriktelepovsky/394cfb8c972c20b14642c9e16232bc53/raw/96c8f6e653c3204477b990ca629f48a8c656e516/os-dependencies | |
ADD os-dependencies / | |
# install OS dependencies | |
RUN apt-get install -y $(grep -vE "^\s*#" os-dependencies | tr "\n" " ") | |
# install nodejs including npm command | |
RUN curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - | |
RUN apt-get install nodejs --assume-yes | |
RUN node --version | |
# install mjml | |
RUN npm install mjml -g --unsafe-perm |
This file contains hidden or 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
# Use an official Python runtime as a parent image | |
#FROM python:3.9.9-slim-bullseye | |
FROM python:3.9.5-slim-buster | |
# output into stdout | |
ENV PYTHONUNBUFFERED 1 | |
# install wget and its dependencies | |
RUN apt-get update | |
RUN apt-get install -y build-essential | |
RUN apt-get install -y gnupg2 | |
RUN apt-get install -y sudo wget curl htop vim | |
# Latest PostgreSQL Prerequsities | |
RUN wget -q https://www.postgresql.org/media/keys/ACCC4CF8.asc -O - | apt-key add - | |
RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
# RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" >> /etc/apt/sources.list.d/pgdg.list' | |
# RUN sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' | |
# install system packages | |
RUN apt-get update | |
# download dependencies | |
# RUN wget https://gist.githubusercontent.com/eriktelepovsky/394cfb8c972c20b14642c9e16232bc53/raw/96c8f6e653c3204477b990ca629f48a8c656e516/os-dependencies | |
ADD os-dependencies / | |
# install OS dependencies | |
RUN apt-get install -y $(grep -vE "^\s*#" os-dependencies | tr "\n" " ") | |
# install nodejs including npm command | |
RUN curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash - | |
RUN apt-get install nodejs --assume-yes | |
RUN node --version | |
# install mjml | |
RUN npm install mjml -g --unsafe-perm |
This file contains hidden or 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
# ps | |
procps | |
# Translations | |
gettext | |
# GNU Compiler Collection | |
gcc | |
# JavaScript | |
#nodejs | |
# Geolocation / PostGIS | |
# gdal-bin | |
gdal-bin binutils libproj-dev libgeoip1 | |
# PostgreSQL | |
postgresql-client-14 | |
libpq-dev | |
# Version control | |
git | |
mercurial | |
# Pillow | |
# https://pillow.readthedocs.io/en/3.0.x/installation.html#external-libraries | |
python3-dev python3-setuptools | |
libjpeg-dev | |
# liblcms2-dev | |
# libtiff4-dev | |
libfreetype6-dev | |
libwebp-dev | |
# openjpeg | |
# tcl8.5-dev | |
# tk8.5-dev | |
# python-tk | |
zlib1g-dev | |
# PDF support (weasyprint) | |
python3-cffi | |
libcairo2 | |
libpango-1.0-0 | |
libpangocairo-1.0-0 | |
libgdk-pixbuf2.0-0 | |
libffi-dev | |
shared-mime-info | |
# PDF support (pdf2image) | |
poppler-utils | |
# lxml | |
libxml2-dev | |
libxslt-dev | |
python3-lxml | |
# matplotlib | |
pkg-config |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment