Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Dockerfile to install the latest poetry #127

Merged
merged 4 commits into from
Feb 14, 2023
Merged
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
9 changes: 8 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
directory: "/debian/"
schedule:
interval: "weekly"
labels:
- "Type: Dependencies"
- "Lang: Dockerfile"
- package-ecosystem: "docker"
directory: "/alpine/"
schedule:
interval: "weekly"
labels:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
env:
DOCKER_LABEL: ${{ matrix.target }}
run: |
docker build -t $DOCKER_USERNAME/$DOCKER_IMAGENAME:$DOCKER_LABEL -f Dockerfile.$DOCKER_LABEL .
docker build -t $DOCKER_USERNAME/$DOCKER_IMAGENAME:$DOCKER_LABEL -f $DOCKER_LABEL/Dockerfile .
- name: Checkout mkdocs
uses: actions/checkout@v2
with:
Expand Down
157 changes: 157 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
### Generated by gibo (https://github.com/simonwhitaker/gibo)
### https://raw.github.com/github/gitignore/ce5da10a3a43c4dd8bd9572eda17c0a37ee0eac1/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
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

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

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .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

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.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/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/


17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,30 @@ docker run --rm -p 8000:8000 -v $PWD:/docs tiryoh/mkdocs-builder:alpine
2. Access http://127.0.0.1:8000 to access the content


## Related projects
## Related Projects

* [Tiryoh/actions-mkdocs](https://github.com/Tiryoh/actions-mkdocs)
* GitHub Actions for MkDocs

## (Advanced) Build Docker Image

To build the docker image locally, run the following command.

```sh
# Debian
docker build -t tiryoh/mkdocs-builder:debian -f debian/Dockerfile .

# Alpine
docker build -t tiryoh/mkdocs-builder:alpine -f alpine/Dockerfile .
```

## License

Copyright (c) 2020 Daisuke Sato
Copyright (c) 2020-2023 Daisuke Sato

This repository is licensed under the MIT License, see [LICENSE](./LICENSE).
Unless attributed otherwise, everything in this repository is licensed under the MIT license.

### Acknowledgements

This repository includes third-party libraries and software. See [THIRD-PARTY-NOTICES.md](./THIRD-PARTY-NOTICES.md).
This repository includes third-party libraries and software. See [THIRD-PARTY-NOTICES.md](./THIRD-PARTY-NOTICES.md).
10 changes: 5 additions & 5 deletions Dockerfile.alpine → alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.7-alpine3.11
FROM python:3.9.16-alpine3.17

ARG MKDOCS_ENV=production

Expand All @@ -13,19 +13,19 @@ ENV MKDOCS_ENV=${MKDOCS_ENV} \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# poetry:
POETRY_VERSION=1.1.4 \
POETRY_VERSION=1.3.2 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
PATH="$PATH:/root/.poetry/bin"
PATH="$PATH:/root/.local/bin"

# Install system deps
RUN apk add --no-cache \
bash git gcc musl-dev libxml2-dev libxslt-dev && \
bash git gcc musl-dev libxml2-dev libxslt-dev libffi-dev && \
apk add --no-cache --virtual .build curl && \
# Installing `poetry` package manager:
# https://github.com/python-poetry/poetry
curl -sSL 'https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py' | python && \
curl -sSL https://install.python-poetry.org | python - || { cat /poetry*.log; exit 1; } && \
poetry --version && \
apk del .build

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile.debian → debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9.5-slim-buster
FROM python:3.9.16-slim-buster

ARG MKDOCS_ENV=production

Expand All @@ -13,19 +13,19 @@ ENV MKDOCS_ENV=${MKDOCS_ENV} \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
# poetry:
POETRY_VERSION=1.1.4 \
POETRY_VERSION=1.3.2 \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
PATH="$PATH:/root/.poetry/bin"
PATH="$PATH:/root/.local/bin"

# Install system deps
RUN apt-get update && \
apt-get install --no-install-recommends -y \
bash curl git libcairo2 && \
# Installing `poetry` package manager:
# https://github.com/python-poetry/poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 - && \
curl -sSL https://install.python-poetry.org | python3 - || { cat /poetry*.log; exit 1; } && \
poetry --version && \
apt-get purge -y curl && \
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false && \
Expand Down