Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 111 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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/
11 changes: 3 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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 link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was done in separate steps (first copy the requirements, then install them, then copy the rest), so that changing the dependencies can be cached when files change in the cwd. That is, I believe that without the extra step, if a file is added/changed, Docker has to execute the COPY step again and then reinstall the dependencies.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will add the step process back in.


COPY . /simoc

Expand Down
16 changes: 5 additions & 11 deletions Dockerfile-celery-worker
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.mysql.yml.jinja
Original file line number Diff line number Diff line change
@@ -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 %}
Expand Down Expand Up @@ -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:
Expand All @@ -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 %}
Expand Down
14 changes: 14 additions & 0 deletions requirements-celery.txt
Original file line number Diff line number Diff line change
@@ -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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should some of these be removed from the requirements.txt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around with these dependencies quite a bit and if I remove anything else from either file something in the program will not function due to missing dependencies.