Skip to content
Snippets Groups Projects
Commit 35e46a16 authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

updated Dockerfile and gitlab ci

parent ab543514
Branches
No related tags found
No related merge requests found
# image: python:3.10-buster
image: harbor.wolke.img.univie.ac.at/podman/mkdocs-computer:latest
# variables:
# PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
# Cache between jobs in the same branch
cache:
- key: $CI_COMMIT_REF_SLUG
# - paths:
# - .cache/pip
stages:
- build
- deploy
create-image:
image: quay.io/podman/stable
stage: build
rules:
- changes:
- Dockerfile
- requirements.txt
script:
- podman build -t registry.phaidra.org/imgw/computer-resources:latest .
- podman login registry.phaidra.org -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD
- podman push registry.phaidra.org/imgw/computer-resources:latest
build:
image: $CI_REGISTRY/imgw/computer-resources:latest
stage: build
# when: manual
# before_script:
# Install all required packages
# - apt-get update -y
# - apt-get install -y -qq graphviz
# - pip install -r requirements.txt
script:
# --strict is too strict :)
- mkdocs build -c --verbose
......@@ -29,16 +24,17 @@ build:
expire_in: 1 hour
paths:
- site/
cache:
- key: $CI_COMMIT_REF_SLUG
deploy:
image: $CI_REGISTRY/imgw/computer-resources:latest
stage: deploy
# when: manual
rules:
- if: '$CI_COMMIT_REF_NAME == "master"'
needs:
- build
# before_script:
# - apt-get update -qq && apt-get install -y -qq sshpass openssh-client rsync
script:
# - sshpass -p "$WOLKE_PASSWORD" scp -oStrictHostKeyChecking=no -r ./site/* $WOLKE_USER@wolke.img.univie.ac.at:/var/www/html/documentation/general/
- sshpass -p "$WOLKE_PASSWORD" rsync -autv --delete -e "ssh -o StrictHostKeyChecking=no" ./site/ $WOLKE_USER@wolke.img.univie.ac.at:/var/www/html/documentation/general
cache:
- key: $CI_COMMIT_REF_SLUG
\ No newline at end of file
FROM python:3.10-buster
FROM python:3.10-slim
ADD requirements.txt /requirements.txt
RUN apt-get update -y \
&& apt-get install -y -qq graphviz sshpass openssh-client rsync \
&& pip install -r requirements.txt
WORKDIR /app
ADD . /app
EXPOSE 8000
CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
\ No newline at end of file
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/* /var/tmp/*
RUN pip install --no-cache-dir -r requirements.txt
# WORKDIR /app
# ADD . /app
# EXPOSE 8000
# CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
# this is a larger image?
# FROM python:3.10-alpine
# ADD requirements.txt /requirements.txt
# RUN apk add --update graphviz sshpass openssh-client rsync gcc python3-dev musl-dev linux-headers\
# && pip install --no-cache-dir -r requirements.txt
# WORKDIR /app
# ADD . /app
# EXPOSE 8000
# CMD ["mkdocs", "serve", "-a", "0.0.0.0:8000"]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment