diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7b01417..1811dec 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,8 @@ image: docker:19.03.1 variables: DOCKER_TLS_CERTDIR: "/certs" - IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + IMAGE_TAG_APP: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG + IMAGE_TAG_NGINX: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-nginx services: - docker:19.03.1-dind @@ -13,5 +14,7 @@ before_script: build: stage: build script: - - docker build -t $IMAGE_TAG . - - docker push $IMAGE_TAG + - docker build -t $IMAGE_TAG_APP . + - docker build -t $IMAGE_TAG_NGINX . -f Dockerfile.nginx + - docker push $IMAGE_TAG_APP + - docker push $IMAGE_TAG_NGINX diff --git a/Dockerfile.nginx b/Dockerfile.nginx new file mode 100644 index 0000000..233eca7 --- /dev/null +++ b/Dockerfile.nginx @@ -0,0 +1,3 @@ +FROM nginx +expose 8080 +COPY nalodeni/static /opt/nalodeni-static diff --git a/docker-compose.sample.yml b/docker-compose.sample.yml index 62a8bae..b5fc4c0 100644 --- a/docker-compose.sample.yml +++ b/docker-compose.sample.yml @@ -1,21 +1,7 @@ -version: '3.4' +version: '3.6' services: - nginx: - image: nginx:latest - container_name: nalodeni-nginx - ports: - - "80:8001" - volumes: - - ./deploy/nginx:/etc/nginx/conf.d - - nalodeni_static:/static_nalodeni - depends_on: - - nalodeni - nalodeni: - image: docker-registry.pirati.cz/to/nalodeni.pirati.cz:master - container_name: nalodeni - volumes: - - nalodeni_static:/nalodeni/static_files + image: docker-registry.pirati.cz/to/nalodeni.pirati.cz:demo2 ports: - "8000" environment: @@ -41,7 +27,13 @@ services: - NALODENI_AUTH_SERVER=s-https://auth.pirati.cz/auth/realms/pirati/ - NALODENI_AUTH_CLIENT_SECRET=s-XXXXXXXXXXXXXXXXXXXX - NALODENI_EMAIL_RECIPIENT_GDPR=s-test@example.com -volumes: - nalodeni_static: - + nginx: + image: docker-registry.pirati.cz/to/nalodeni.pirati.cz-nginx:demo2 + ports: + - "8080:8080" + volumes: + - "/var/opt/docker/nginx.conf:/etc/nginx/conf.d/nalodeni.conf" + - ./deploy/nginx:/etc/nginx/conf.d + depends_on: + - nalodeni diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 762d7a9..b647e82 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -8,7 +8,7 @@ cd /nalodeni python manage.py migrate -python manage.py collectstatic --noinput --clear +#python manage.py collectstatic --noinput --clear python manage.py loaddata nalodeni_interestregion nalodeni_topics nalodeni_skills nalodeni_counties