Skip to content

Instantly share code, notes, and snippets.

View Creatiwww's full-sized avatar
☮️

Vitaly Panukhin Creatiwww

☮️
View GitHub Profile
@Creatiwww
Creatiwww / app.py
Created April 14, 2020 00:17
Telegram Bot example app.py file
from flask import Flask, request
import telegram
import os
import json
TOKEN = os.environ['TOKEN']
bot = telegram.Bot(token=TOKEN)
app = Flask(__name__)
version: '3.0'
services:
app:
image: ${IMAGE_APP_TAG}
build: ./app/
environment:
# stage or prod specific
- EXTERNAL_SERVICE_KEY=${EXTERNAL_SERVICE_KEY}
# general one
FROM python:latest
COPY ./requirements.txt /app/requirements.txt
WORKDIR /app
RUN pip install -r requirements.txt
COPY . /app
CMD gunicorn app:app -b 0.0.0.0:80
import os
from flask import Flask
EXTERNAL_SERVICE_KEY = os.environ.get('EXTERNAL_SERVICE_KEY')
app = Flask(__name__)
@app.route("/")
def index():
image: creatiwww/docker-compose:latest
services:
- docker:dind
variables:
STAGE_SERVER_IP: 10.10.10.1
PROD_SERVER_IP: 10.10.10.2
STAGE_SERVER_USER: gitlab
PROD_SERVER_USER: gitlab
FROM alpine:latest
RUN touch /var/log/app.log
ADD script.sh /home/
RUN chmod +x /home/script.sh
CMD ./home/script.sh
FROM docker.elastic.co/beats/filebeat:7.7.0
# Copy our custom configuration file
COPY filebeat.yml /usr/share/filebeat/filebeat.yml
USER root
RUN chown root:filebeat /usr/share/filebeat/filebeat.yml
RUN mkdir /usr/share/filebeat/dockerlogs
RUN chown -R root /usr/share/filebeat/
RUN chmod -R go-w /usr/share/filebeat/
CMD ./filebeat -e
FROM docker.elastic.co/beats/filebeat:7.7.0
# Copy our custom configuration file
COPY filebeat.yml /usr/share/filebeat/filebeat.yml
USER root
RUN chown root:filebeat /usr/share/filebeat/filebeat.yml
RUN mkdir /usr/share/filebeat/dockerlogs
RUN chown -R root /usr/share/filebeat/
RUN chmod -R go-w /usr/share/filebeat/
CMD ./filebeat -e
FROM docker.elastic.co/logstash/logstash:7.7.0
RUN rm -f /usr/share/logstash/pipeline/logstash.conf
COPY logstash.conf /usr/share/logstash/pipeline/
CMD bin/logstash -f /usr/share/logstash/pipeline/logstash.conf
@Creatiwww
Creatiwww / docker-compose.yml
Last active June 19, 2020 01:05
Elasticsearch (ELK)
version: '3.0'
services:
logs_app:
build: ./logs_app/
volumes:
- filebeat_data:/var/log
filebeat:
build: ./filebeat/