diff --git a/.dockerignore b/.dockerignore index fa56f9e3..3ef33714 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,114 @@ +# Project-specific ignores + # SSL certificates certs certbot + + +# Generic ignores + +**/.git +**/.github +**/.gitignore +**/.vscode +**/coverage +**/.env +**/.aws +**/.ssh + +Dockerfile +README.md +docker-compose.yml +**/.DS_Store +**/venv +**/env + +# Git +.git +.gitignore +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ diff --git a/Dockerfile b/Dockerfile index a5f64ca7..42e0799c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,11 @@ -FROM ubuntu:22.04 - -MAINTAINER Iurii Milovanov "duruku@gmail.com" +FROM python:3.11.3-slim-bullseye RUN apt-get update && \ apt-get install -y --no-install-recommends \ - python3-pip \ - python3-setuptools \ - curl && \ - python3 -m pip install --upgrade pip + curl COPY ./requirements.txt /simoc/requirements.txt -RUN python3 -m pip install -r /simoc/requirements.txt +RUN pip install -r /simoc/requirements.txt COPY . /simoc diff --git a/Dockerfile-celery-worker b/Dockerfile-celery-worker index 05d3f514..496fc225 100644 --- a/Dockerfile-celery-worker +++ b/Dockerfile-celery-worker @@ -1,16 +1,10 @@ -FROM ubuntu:22.04 - -MAINTAINER Iurii Milovanov "duruku@gmail.com" +FROM python:3.11.3-slim-bullseye RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - python3-pip \ - python3-setuptools \ - curl && \ - python3 -m pip install --upgrade pip - -COPY ./requirements.txt /simoc/requirements.txt -RUN python3 -m pip install -r /simoc/requirements.txt + apt-get install -y --no-install-recommends + +COPY ./requirements-celery.txt /simoc/requirements-celery.txt +RUN pip install -r /simoc/requirements-celery.txt COPY . /simoc diff --git a/docker-compose.mysql.yml.jinja b/docker-compose.mysql.yml.jinja index 1e796815..d3b92245 100644 --- a/docker-compose.mysql.yml.jinja +++ b/docker-compose.mysql.yml.jinja @@ -1,7 +1,7 @@ version: '3.6' services: nginx: - image: nginx + image: nginx:1.25-alpine {% if use_certbot %} command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'" {% endif %} @@ -57,7 +57,7 @@ services: {% if redis_use_bitnami %} image: bitnami/redis:latest {% else %} - image: redis:latest + image: redis:7.0-alpine {% endif %} restart: always ports: @@ -67,7 +67,7 @@ services: environment: - REDIS_PASSWORD=${REDIS_PASSWORD} {% if not redis_use_bitnami %} - command: ["bash", "-c", 'docker-entrypoint.sh --requirepass $REDIS_PASSWORD'] + command: ["sh", "-c", 'docker-entrypoint.sh --requirepass $REDIS_PASSWORD'] {% endif %} celery-worker: {% if use_dockerhub %} diff --git a/requirements-celery.txt b/requirements-celery.txt new file mode 100644 index 00000000..53456035 --- /dev/null +++ b/requirements-celery.txt @@ -0,0 +1,14 @@ +celery==5.2.7 +flask==2.3.2 +flask-login==0.6.2 +flask_socketio==5.3.2 +flask-sqlalchemy==2.5.1 +jinja2==3.1.2 +mesa==1.1.1 +mysql-connector-python==8.0.32 +numpy==1.24.3 +quantities==0.14.1 +redis==4.5.4 +scikit-learn==1.2.0 +scipy==1.9.3 +sqlalchemy==1.4.46 \ No newline at end of file