From b914ea210fbbcc10413a5ee78a3a7c5aab2807a0 Mon Sep 17 00:00:00 2001 From: Radek Czajka <rczajka@rczajka.pl> Date: Fri, 20 Sep 2024 23:16:20 +0200 Subject: [PATCH] Some archeology. --- Dockerfile | 23 +++++++++++++++++++++++ docker-compose.yml | 9 +++++++++ manage | 12 ++++++++++++ requirements.txt | 11 ++++++----- 4 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 Dockerfile create mode 100644 docker-compose.yml create mode 100755 manage diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..9aaaeca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM python:2.7-alpine AS base + +RUN apk update && apk add --no-cache \ + libxslt-dev libxml2-dev build-base \ + tiff-dev jpeg-dev openjpeg-dev zlib-dev freetype-dev lcms2-dev \ + libwebp-dev tcl-dev tk-dev harfbuzz-dev fribidi-dev \ + libxcb-dev libpng-dev \ + postgresql-dev +COPY requirements.txt requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +WORKDIR /app + + +FROM base AS dev + + + +FROM base AS prod + +RUN pip install --no-cache-dir gunicorn psycopg2-binary + +COPY . /app diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..b027789 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,9 @@ +version: '3' + +services: + dev: + build: + context: . + target: dev + volumes: + - .:/app diff --git a/manage b/manage new file mode 100755 index 0000000..c27ba11 --- /dev/null +++ b/manage @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ "$1" = "runserver" ] +then + PORT="$2" + [ -z "$PORT" ] && PORT=8000 + EXPOSED=127.0.0.1:"$PORT" + echo "expose as: $EXPOSED" + exec docker-compose run -p "$EXPOSED":"$PORT" dev python $PYARGS manage.py runserver 0.0.0.0:"$PORT" +else + exec docker-compose run dev python $PYARGS manage.py "$@" +fi diff --git a/requirements.txt b/requirements.txt index b283ef4..7c9afd7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ Django>=1.6,<1.7 South>=0.7.4 django-pipeline>=1.3,<1.4 -python-memcached +python-memcached==1.53 django-piwik django-extensions==1.5.7 # because South django-piston==0.2.2.1.2 @@ -21,7 +21,7 @@ Feedparser django-honeypot # Librarian -lxml>=3.0 +lxml==3.3.5 texml # sponsors @@ -29,16 +29,17 @@ pillow django-sponsors>=1.1,<1.2 django-haystack>=2.0,<2.1 -pysolr>=3,<4 +pysolr==3.2.0 pybbm>=0.14,<0.15 +django-annoying==0.7.9 django-libravatar sorl-thumbnail>=11,<12 -pyyaml +pyyaml==3.11 django-subdomains>=2.0.4,<2.1 markdown2 -mailchimp3 \ No newline at end of file +mailchimp3 -- 2.20.1