mirror of
https://framagit.org/la-chariotte/la-chariotte.git
synced 2025-05-01 11:22:24 +02:00
Docker
This commit is contained in:
parent
675fdac7a3
commit
9d04b173bd
2 changed files with 36 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
stages:
|
||||
- build
|
||||
- test
|
||||
- docker
|
||||
|
||||
before_script:
|
||||
- export CACHE_PATH="/venvs/${CI_PROJECT_NAME}/$(date +week-%V-%Y)"
|
||||
|
@ -41,3 +42,22 @@ tests:
|
|||
- if [ "$CI_COMMIT_REF_NAME" = 'develop' ] ; git fetch origin main ; then diff-cover coverage.xml --fail-under=90 && exit 0 ; fi
|
||||
- git fetch origin develop ; diff-cover coverage.xml --fail-under=90 --compare-branch origin/develop
|
||||
- echo "Tests done."
|
||||
|
||||
build_docker_and_publish:
|
||||
stage: docker
|
||||
only:
|
||||
- main
|
||||
- develop
|
||||
image: docker:git
|
||||
tags:
|
||||
- dind
|
||||
dependencies:
|
||||
- tests
|
||||
services:
|
||||
- docker:dind
|
||||
script:
|
||||
- docker build --pull --no-cache -f Dockerfile -t $CI_REGISTRY/hashbangfr/la_chariotte:latest .
|
||||
- docker tag $CI_REGISTRY/hashbangfr/la_chariotte:latest $CI_REGISTRY/hashbangfr/la_chariotte:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}
|
||||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
|
||||
- docker push $CI_REGISTRY/hashbangfr/la_chariotte:latest
|
||||
- docker push $CI_REGISTRY/hashbangfr/la_chariotte:${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}
|
||||
|
|
16
Dockerfile
Normal file
16
Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
FROM python:3.9-slim
|
||||
|
||||
WORKDIR /srv/app
|
||||
|
||||
RUN apt update && \
|
||||
apt install --no-install-recommends -y libpq-dev build-essential curl gcc sassc libpango-1.0-0 libpangoft2-1.0-0 libjpeg-dev libopenjp2-7-dev libffi-dev libpangoft2-1.0-0 libcairo2 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 shared-mime-info &&\
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --chown=www-data:www-data . .
|
||||
|
||||
run python -m pip install --upgrade pip \
|
||||
&& python -m pip install uwsgi \
|
||||
&& python -m pip install -r requirements.txt \
|
||||
&& python -m pip install .
|
||||
|
||||
ENTRYPOINT [ "uwsgi", "-i", "uwsgi.ini" ]
|
Loading…
Reference in a new issue