From bff374c5805d6561f925ddb3328c2ddd08bcde02 Mon Sep 17 00:00:00 2001 From: schmelczerandras Date: Mon, 21 Sep 2020 15:47:29 +0200 Subject: [PATCH] Remove CD --- .dockerignore | 5 ---- .github/workflows/main.yaml | 50 ---------------------------------- Dockerfile | 27 ------------------- docker-compose.yml | 31 ---------------------- nginx-config/nginx.conf | 53 ------------------------------------- 5 files changed, 166 deletions(-) delete mode 100644 .dockerignore delete mode 100644 .github/workflows/main.yaml delete mode 100644 Dockerfile delete mode 100644 docker-compose.yml delete mode 100644 nginx-config/nginx.conf diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 2044e20..0000000 --- a/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -Dockerfile -node_modules -dist -package-lock.json -.* diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml deleted file mode 100644 index 37ed19d..0000000 --- a/.github/workflows/main.yaml +++ /dev/null @@ -1,50 +0,0 @@ -name: Deploy everything -on: - push: - branches: - - main -env: - CONTAINER_REGISTRY: schmelczera - DOMAIN: schmelczer.dev - PROJECT_NAME: sdf-2d-demo - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout current branch with lfs - uses: actions/checkout@main - with: - lfs: true - - - name: Setup auth tokens - run: | - docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push frontend - run: | - docker build . -t $CONTAINER_REGISTRY/$PROJECT_NAME - docker push $CONTAINER_REGISTRY/$PROJECT_NAME - - deploy: - runs-on: ubuntu-latest - needs: - - build - steps: - - name: Checkout current branch with lfs - uses: actions/checkout@main - with: - lfs: true - - - name: Setup auth tokens - run: | - # SSH key - mkdir ~/.ssh - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 - chmod 400 ~/.ssh/id_ed25519 - ssh -o StrictHostKeyChecking=no root@$DOMAIN uptime - - - name: Stack deploy - run: | - DOCKER_HOST=ssh://root@$DOMAIN docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} - DOCKER_HOST=ssh://root@$DOMAIN docker stack deploy $PROJECT_NAME -c docker-compose.yml --with-registry-auth diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index b0b745e..0000000 --- a/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -FROM schmelczera/error-pages as build-error-pages -RUN python build.py 403 404 50x - - -FROM node:latest as build-webpage -WORKDIR /home/node - -COPY src src -COPY static static -COPY package.json tsconfig.json webpack.config.js ./ - -RUN npm install -RUN npm run build - -FROM nginx:alpine - -HEALTHCHECK --interval=1m --timeout=10s CMD curl --fail http://localhost/ || exit 1 - -WORKDIR /usr/share/nginx/html - -RUN rm -rf * -COPY --from=build-webpage /home/node/dist . -COPY --from=build-error-pages /home/python/built errors -RUN find . -type f | xargs gzip -k9 &&\ - chmod -R 555 . - -COPY nginx-config /etc/nginx/ diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 503b7ee..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,31 +0,0 @@ -version: "3.8" - -services: - sdf-2d-demo: - init: true - image: schmelczera/sdf-2d-demo - networks: - - network - deploy: - replicas: 3 - resources: - limits: - cpus: "0.1" - memory: 16M - reservations: - cpus: "0.1" - memory: 16M - placement: - max_replicas_per_node: 1 - update_config: - parallelism: 1 - failure_action: rollback - delay: 10s - monitor: 10s - restart_policy: - condition: on-failure - window: 30s - -networks: - network: - driver: overlay diff --git a/nginx-config/nginx.conf b/nginx-config/nginx.conf deleted file mode 100644 index a8bfb5a..0000000 --- a/nginx-config/nginx.conf +++ /dev/null @@ -1,53 +0,0 @@ -user nginx; -worker_processes auto; - -error_log /var/log/nginx/error.log warn; - -pid /var/run/nginx.pid; - -events { - worker_connections 1024; -} - -http { - server_tokens off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - access_log off; - - sendfile on; - sendfile_max_chunk 1m; - tcp_nopush on; - - keepalive_timeout 65; - - gzip on; - gzip_static on; - gzip_vary on; - gzip_min_length 10240; - gzip_proxied any; - gzip_disable "MSIE [1-6]\.(?!.*SV1)"; - - server { - listen 80; - server_name localhost; - - root /usr/share/nginx/html; - index index.html; - - location ~* \.(jpg|jpeg|png|ico)$ { - expires 30d; - } - - error_page 403 /403.html; - error_page 404 /404.html; - error_page 500 501 502 503 504 /50x.html; - - location ~ ^/(403|404|50x).html$ { - root /usr/share/nginx/html/errors; - internal; - } - } -}