Skip to content

Instantly share code, notes, and snippets.

@3lement3
3lement3 / traefik.md
Created March 3, 2023 20:20 — forked from dancheskus/traefik.md
Traefik, как обратный прокси в Docker (пример с 2 react проектами)

Traefik, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

Цели

  • Запустить traefik в одном контейнере
  • Запустить другие проекты в других контейнерах
  • Соединить все контейнеры в одну docker cеть
  • Настроить контейнеры с проектами так, что-бы они объясняли traefik'у, какие url ведут на конкретный проект

Более удобной и актуальной версией является эта статья с использованием traefik

https://gist.github.com/dancheskus/365e9bc49a73908302af19882a86ce52


Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

@3lement3
3lement3 / hotReboot.js
Last active March 14, 2020 21:17
hot reboot in react index page
/*
* insert to end file index.js
*/
if (module.hot) {
module.hot.accept();
}
@3lement3
3lement3 / str.py
Created March 8, 2020 23:12
Repeated character compression
inputString = str(input())
l = [[inputString[0], 1]]
for x in inputString[1:]:
if (x == l[len(l) - 1][0]):
l[len(l) - 1][1] += 1
else:
l.append([x, 1])
t = ''
for m in l:
s = m[0] + str(m[1])
@3lement3
3lement3 / nok.py
Created March 8, 2020 21:10
Finde nok
a = int(input())
b = int(input())
nok = min(a, b)
while True:
if nok % a == 0 and nok % b == 0:
break
nok += 1
print(nok)
@3lement3
3lement3 / SumInputInteger.py
Created March 8, 2020 20:29
Sum input numbers by zero stop
num = int(input())
list = []
while num != 0:
list.append(num)
num = int(input())
print('Сумма:', sum(list))
@3lement3
3lement3 / maxmin.py
Created March 8, 2020 12:07
Accepts 3 numbers, outputs the maximum number, the minimum number, and then the rest
l = list(map(int, (input() for i in range(3))))
print(max(l))
l.remove(max(l))
print(min(l))
l.remove(min(l))
print(l[0])
@3lement3
3lement3 / endsNumber.py
Created March 8, 2020 11:44
The number ends
count = int(input())
showIndex = 2
lastTwoDigits = count % 100
tens = lastTwoDigits // 10
ones = lastTwoDigits % 10
if tens == 1:
showIndex = 2
elif ones == 1:
showIndex = 0
@3lement3
3lement3 / happyTicket.py
Created March 7, 2020 22:44
Finde happy ticket in arrays string
ticketNumber = input()
numbers = [int(n) for n in ticketNumber]
if sum(numbers[:3]) == sum(numbers[-3:]):
print('I\'m happy')
else:
print('I\'m no happy')
@3lement3
3lement3 / event.js
Created March 4, 2020 21:08
event oop
//3lement generated 04/03/2020
/**
* <div id="btn">
<button data-action='hideBox'>HIDE</button>
<button data-action='showBox'>SHOW</button>
<div id="box1"></div>
</div>
*/
/**
* creat base class