Files
gitea-pages/docs/guides/docker.md
Basil Bruhn 9541b83dac
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 8s
more docu to docker images and registry and how to tag images
Signed-off-by: Basil Bruhn <basil.bruhn@psi.ch>
2025-12-12 14:44:55 +01:00

78 lines
1.9 KiB
Markdown

# Docker
## Dockerfiles
```
# Start with a minimal Python base image
FROM python:3.12-alpine
# Install dependencies
# Jeder Step (RUN befehl) generiert ein neuer image layer!
RUN apk add --no-cache git bash nodejs\
&& pip install --no-cache-dir \
mkdocs \
mkdocs-material \
mkdocs-mermaid2-plugin \
mkdocs-git-revision-date-localized-plugin \
mkdocs-macros-plugin
# Set work directory
# Environment variables -> Lookup :)
WORKDIR /site
# Default command
ENTRYPOINT ["mkdocs"]
```
### Altenative
```
FROM alpine
# 1. Install Python 3, pip and build tools (needed for packages with C extensions)
RUN apk --no-cache add\
python3 \
py3-pip \
git \
nodejs
# 2. Install the Python packages
RUN python3 -m venv /opt/python-env
RUN /opt/python-env/bin/python3 -m pip install --upgrade pip
RUN /opt/python-env/bin/pip install --no-cache-dir \
mkdocs-material \
mkdocs-awesome-pages-plugin
# 3. (Optional) Clean up if you added any temporary files
RUN rm -rf /var/cache/apk/*
```
## Dockerhub
(Not the other hub...)
- https://hub.docker.com/_/node
- https://hub.docker.com/_/postgres
- Optional : https://hub.docker.com/_/nginx
### Linux Webhosting
- https://linux.psi.ch/documentation/services/admin-guide/webhosting/?h=webhosting
- https://linux.psi.ch/documentation/engineering-guide/webhosting/?h=webhosting#update-containersi
- https://gitea.psi.ch/linux/WebHosting
## Docker registry
https://gitea.psi.ch/pombas_n/gitea-pages/packages
| Registry name | Organization Name | Repo Name | Version |
|---------------|-------------------|-----------|---------|
| gitea.psi.ch | images | alpine-zensical | latest |
```
gitea.psi.ch/images/alpine-zensical latest b5920bb288b0 7 days ago 206MB
```
!note Latest ist nicht gleicht das aktuellste package, es ist nur ein "alias" das packet muss jedesmal neu gebaut werden als latest und 1.2, 1.3 etc.