Commit d4d48591 authored by nimrod's avatar nimrod
Browse files

A general master branch.

I'm moving some services to ns4, some will remain on host01. I'm
branching to have specific deployment for each host. So have a minimal
and generic master branch so common changes will be done there and I'll
rebase the other branches on top of it.
parent c29e703d
Loading
Loading
Loading
Loading
+0 −32
Original line number Diff line number Diff line
@@ -2,35 +2,3 @@
include:
  - project: shore/ci-templates
    file: templates/pre-commit.yml

image: adarnimrod/ci-images:docker

stages:
  - test
  - build
  - run

build:
  stage: build
  tags: ["host01.shore.co.il"]
  variables:
    COMPOSE_DOCKER_CLI_BUILD: "1"
    DOCKER_BUILDKIT: "1"
  script:
    - docker-compose build --no-cache --pull
    - docker-compose pull --quiet

run:
  stage: run
  tags: ["host01.shore.co.il"]
  when: manual
  script:
    - docker-compose up --detach --remove-orphans
    # yamllint disable rule:line-length
    - |
        for i in $(seq 12)
        do
            docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break
            sleep 10
        done
        ! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$'
+2 −10
Original line number Diff line number Diff line
FROM nginx:1.19-alpine
ARG TRANSMISSION
FROM nginx:1.19.6-alpine
# hadolint ignore=DL3018
RUN rm -rf /etc/nginx/conf./* && \
    chmod 777 /run && \
@@ -18,18 +17,11 @@ RUN rm -rf /etc/nginx/conf./* && \
                -out /var/ssl/site.crt \
                -days 2 \
                -subj "/C=US/ST=IL/L=None/O=None/OU=None/CN=localhost/" && \
    cp /var/ssl/site.crt /var/ssl/mail.crt && \
    cp /var/ssl/site.key /var/ssl/mail.key && \
    setcap CAP_NET_BIND_SERVICE=+ep "$(command -v nginx)" && \
    chown nginx /var/ssl/site.* /var/ssl/mail.*
    chown nginx /var/ssl/site.*
COPY www/ /var/www/
COPY conf.d/ /etc/nginx/conf.d/
COPY snippets/ /etc/nginx/snippets/
# Another option would be to copy the file to the template directory and have
# the environment variable substitution happen in runtime, but that way would
# miss checking the syntax during the build process.
# hadolint ignore=SC2097,SC2098
RUN TRANSMISSION=$TRANSMISSION sed -i "s/TRANSMISSION/$TRANSMISSION/" /etc/nginx/conf.d/www.shore.co.il.conf
USER nginx
RUN nginx -t
HEALTHCHECK CMD curl --fail --verbose --user-agent 'Docker health check' http://localhost/ || exit 1
+5 −0
Original line number Diff line number Diff line
@@ -4,6 +4,11 @@

> Web proxy Dockerized setup.

## Branches

The `master` branch doesn't have any configuration in it. The `ns4` and `host01`
branches have configuration for those hoss.

## License

This software is licensed under the MIT license (see `LICENSE.txt`).
+0 −21
Original line number Diff line number Diff line
server {
    listen      80;
    listen      [::]:80;
    server_name autoconfig.shore.co.il;
    root        /var/www/autoconfig.shore.co.il/;
    include     snippets/www-acme-challenge.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/robots-allow-all.conf;
}

server {
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name autoconfig.shore.co.il;
    root        /var/www/autoconfig.shore.co.il/;
    include     snippets/robots-allow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/ssl.conf;
}

conf.d/git.shore.co.il.conf

deleted100644 → 0
+0 −30
Original line number Diff line number Diff line
map $host $git { default gitlab; }

server {
    listen      80;
    listen      [::]:80;
    server_name git.shore.co.il;
    include     snippets/robots-allow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/www-acme-challenge.conf;
    include     snippets/redirect-https.conf;
}

server {
    listen      443 ssl;
    listen      [::]:443 ssl;
    server_name git.shore.co.il;
    include     snippets/robots-allow-all.conf;
    include     snippets/ads-txt.conf;
    include     snippets/security-txt.conf;
    include     snippets/ssl.conf;

    location / {
        proxy_pass              http://$git$request_uri;
        proxy_http_version      1.1;
        include                 snippets/proxy-headers.conf;
        proxy_set_header        X-Forwarded-Ssl on;
        client_max_body_size    512m;
    }
}
Loading