Skip to content

Instantly share code, notes, and snippets.

View diyor28's full-sized avatar

Diyor Khaydarov diyor28

View GitHub Profile
@diyor28
diyor28 / traefik.yml
Last active May 30, 2021 20:34
Traefik static configuration
defaultEntryPoints: # makes the 443 port default.
- websecure
entryPoints:
web: # defines an entrypoint called web
address: :80 # use port 80
http:
redirections: # redirect to entrypoint websecure
entryPoint:
to: websecure
@diyor28
diyor28 / docker-compose.yml
Last active May 30, 2021 21:39
Traefik docker-compose
version: '3.8'
services:
reverse-proxy:
image: traefik:v2.4
restart: always
ports:
- "80:80"
- "443:443"
labels:
@diyor28
diyor28 / docker-compose.yml
Last active May 30, 2021 21:54
docker-compose for sample Vue application
version: '3.8'
services:
front:
container_name: front_${COMPOSE_PROJECT_NAME}
image: front:${COMPOSE_PROJECT_NAME}
build:
context: ./
args:
- VUE_APP_BASE_URL=/${COMPOSE_PROJECT_NAME}/
@diyor28
diyor28 / build.yml
Last active May 30, 2021 21:29
Github Actions build on push with Docker.
name: Build and deploy to staging # Will be displayed in Github's Actions tab.
on: [ push ] # On which events to trigger this workflow.
jobs: # Defines what to run.
build:
runs-on: [ self-hosted, staging ]
steps:
- name: Get branch name (merge)
if: github.event_name != 'pull_request'
@diyor28
diyor28 / config.yml
Last active May 31, 2021 02:10
Traefik dynamic configuration
tls:
certificates:
- certFile: /etc/letsencrypt/live/stg.example.com/fullchain.pem
keyFile: /etc/letsencrypt/live/stg.example.com/privkey.pem
- certFile: /etc/letsencrypt/live/traefik.example.com/fullchain.pem
keyFile: /etc/letsencrypt/live/traefik.example.com/privkey.pem
@diyor28
diyor28 / Dockerfile
Created May 30, 2021 21:26
Vue sample app Dockerfile
FROM bitnami/git:latest
FROM node:12.18.2-alpine3.9 as build-stage
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --pure-lockfile --non-interactive && yarn global add @vue/cli
ARG VUE_APP_BASE_URL
COPY . .
RUN NODE_OPTIONS=--max_old_space_size=4096 yarn build --mode staging
name: Cleanup on branch removal
on: [ delete ]
jobs:
build:
runs-on: [ self-hosted, staging ]
steps:
- uses: actions/checkout@v2
- name: Cleanup
@diyor28
diyor28 / setup-pip.sh
Created February 13, 2022 18:05
setup-pip.sh url-to-your-pypi-mirror
pip config --user set global.index-url $1
# https://www.tensorflow.org/install/source#tested_build_configurations
FROM python:{py_version} as tf-build
COPY --from=diyor28/bazel:{bazel_version} /usr/local/bin/bazel /usr/local/bin
RUN DEBIAN_FRONTEND=noninteractive && apt-get -y update && apt-get -y install git openjdk-11-jdk
RUN git clone https://github.com/tensorflow/tensorflow
WORKDIR /tensorflow
RUN {git_command}
ENV PYTHONUNBUFFERED=1
RUN pip install -U pip
FROM python:3.9.4 as python-build
RUN apt-get update && apt-get install -y
WORKDIR /app
ENV PYTHONUNBUFFERED=1
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD python migrate.py && gunicorn --bind=0.0.0.0 --access-logfile '-' main:app -k uvicorn.workers.UvicornWorker