This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
permission issues: | |
> ls -l /var/run/docker.sock | |
> sudo chmod 666 /var/run/docker.sock | |
Create a Docker Image: (assuming you already have Dockerfile in ur folder) | |
> docker build -t <my-image-name> . | |
RUN ......................................... | |
Run a built created image |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gunicorn -w 2 -k uvicorn.workers.UvicornWorker main:app --max-requests 100 --max-requests-jitter 10 --threads 5 | |
# .......................................................................................... | |
import asyncio | |
import os | |
import logging | |
# from asyncio.log import logger | |
from time import sleep |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
zookeeper: | |
# image: confluentinc/cp-zookeeper:latest | |
image: bitnami/zookeeper:3.9 | |
container_name: zookeeper | |
ports: | |
- "2181:2181" | |
environment: | |
ALLOW_ANONYMOUS_LOGIN: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import socket | |
def parse_http_request(request): | |
headers, _, body = request.partition("\r\n\r\n") | |
request_line = headers.splitlines()[0] | |
method, path, _ = request_line.split() | |
return method, path, headers, body | |
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
OlderNewer