Browse Source

Verze se statikou v nginx

master
Andrej Ramašeuski 2 years ago
parent
commit
19232e13ae
  1. 9
      .gitlab-ci.yml
  2. 3
      Dockerfile.nginx
  3. 30
      docker-compose.sample.yml
  4. 2
      docker-entrypoint.sh

9
.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-nginx:$CI_COMMIT_REF_SLUG
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

3
Dockerfile.nginx

@ -0,0 +1,3 @@
FROM nginx
expose 8080
COPY nalodeni/static /opt/nalodeni-static

30
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

2
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

Loading…
Cancel
Save