Skip to content

Commit

Permalink
slightly smaller docker image via Alpine Linux (#59)
Browse files Browse the repository at this point in the history
* slightly smaller docker image via Alpine Linux

* ignore .github/ and more consistent Dockerfile
  • Loading branch information
ShahinSorkh authored Jun 7, 2022
1 parent f3609a8 commit 5dc4b0d
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 19 deletions.
133 changes: 123 additions & 10 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,133 @@
__pycache__
*.pyc
*.pyo
*.pyd
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
env
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# 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
.tox

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
.git
.mypy_cache
.pytest_cache
.hypothesis
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

tracevis_data/
.git/
.github/
14 changes: 6 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
FROM python:3.10.1-slim-bullseye
FROM python:3.10-alpine

ENV PYTHONUNBUFFERED=TRUE

ENV TRACEVIS_OUTPUT_DIR=/tracevis_data/

RUN mkdir -p /tracevis_data
ENV PYTHONUNBUFFERED 1
ENV TRACEVIS_OUTPUT_DIR /tracevis_data/

WORKDIR /tracevis

# Install requirements before copying whole source. (used for quick build)
COPY requirements.txt .

RUN pip install -r requirements.txt
RUN pip install --no-cache-dir -U pip && \
pip install --no-cache-dir -r requirements.txt

COPY . .

ENTRYPOINT [ "python", "tracevis.py" ]

CMD [ "-h" ]
CMD [ "-h" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ or with docker image:

```sh
docker run \
--mount type=bind,source=/path/to/,target=/tracevis_data/ \
--mount type=bind,source=/path/to/results,target=/tracevis_data/ \
ghcr.io/wikicensorship/tracevis --file /tracevis_data/file.json
# OR
docker run \
Expand Down

0 comments on commit 5dc4b0d

Please sign in to comment.