Skip to content

Instantly share code, notes, and snippets.

View esron's full-sized avatar
🏠
Working from home

Esron Silva esron

🏠
Working from home
  • Red Hat
  • Petrolina - PE, Brasil.
  • X @oesron
View GitHub Profile
import time
import redis
from flask import Flask
app = Flask(__name__)
cache = redis.Redis(host='redis', port=6379)
def get_hit_count():
#! /bin/bash
docker exec -it web "$@"
version: '2'
services:
web:
container_name: web
image: esron/ubuntu-web-server
volumes:
- .:/home/project-folder
ports:
- '8000:80'
version: '2'
services:
web:
container_name: web
build: .
volumes:
- .:/home/project-folder
ports:
- '8000:80'
#!/bin/bash
update-alternatives --set php /usr/bin/php7.2
a2enmod php7.2
service apache2 restart
apachelinker /home/project-folder/public
tail -f /tmp/dev.log
<VirtualHost *:80>
ServerName dev.app
ServerAlias www.dev.app
ServerAdmin webmaster@localhost
DocumentRoot /var/www/dev
<Directory />
Options -Indexes +FollowSymLinks +MultiViews +Includes
AllowOverride AuthConfig
#!/bin/bash
PUBLIC_FOLDER=$1
ln -sfn $1 /var/www/dev
service apache2 start
FROM ubuntu:16.04
LABEL Author="Esron Silva esron.silva@sysvale.com"
ENV PATH ${PATH}:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y software-properties-common \
apache2 \
@esron
esron / apache.conf
Created October 5, 2018 23:43
Files for download in a cloud build of a Docker image
<VirtualHost *:80>
ServerName dev.app
ServerAlias www.dev.app
ServerAdmin webmaster@localhost
DocumentRoot /var/www/dev
<Directory />
Options -Indexes +FollowSymLinks +MultiViews +Includes
AllowOverride AuthConfig
@esron
esron / entrypoint.sh
Created August 22, 2018 11:49
An entry point for a simple Docker image.
#! /bin/bash
if [ $# -eq 0 ]; then
/usr/games/fortune | /usr/games/cowsay
else
/usr/games/cowsay "$@"
fi