Skip to content

Instantly share code, notes, and snippets.

View ivanpanshin's full-sized avatar

Ivan Panshin ivanpanshin

View GitHub Profile
echo killing old docker processes
docker-compose rm -fs
echo building docker containers
docker-compose up --build -d
echo killing old docker processes
docker-compose rm -fs
echo building docker containers
docker-compose up --build -d
@ivanpanshin
ivanpanshin / docker-compose.yml
Created April 28, 2020 11:48
docker compose for flask + gunicorn + nginx
version: '3'
services:
flask_app:
container_name: flask_app
restart: always
build: ./flask_app
ports:
- "8000:8000"
command: gunicorn -w 1 -b 0.0.0.0:8000 wsgi:server
@ivanpanshin
ivanpanshin / requirements.txt
Created April 28, 2020 10:53
requirements file for Flask + Gunicorn
flask
gunicorn
@ivanpanshin
ivanpanshin / project.conf
Created April 28, 2020 10:21
Nginx project conf
server {
listen 80;
server_name docker_flask_gunicorn_nginx;
location / {
proxy_pass http://flask_app:8000;
# Do not change this
proxy_set_header Host $host;
@ivanpanshin
ivanpanshin / Dockerfile
Created April 28, 2020 10:19
Dockerfile for nginx
FROM nginx:1.15.8
RUN rm /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/
RUN rm /etc/nginx/conf.d/default.conf
COPY project.conf /etc/nginx/conf.d/
@ivanpanshin
ivanpanshin / Dockerfile
Created April 28, 2020 10:19
Dockerfile for nginx
FROM nginx:1.15.8
RUN rm /etc/nginx/nginx.conf
COPY nginx.conf /etc/nginx/
RUN rm /etc/nginx/conf.d/default.conf
COPY project.conf /etc/nginx/conf.d/
@ivanpanshin
ivanpanshin / project.conf
Last active April 28, 2020 10:20
Nginx project conf
server {
listen 80;
server_name docker_flask_gunicorn_nginx;
location / {
proxy_pass http://flask_app:8000;
# Do not change this
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@ivanpanshin
ivanpanshin / project.conf
Created April 28, 2020 10:12
Nginx project conf
server {
listen 80;
server_name docker_flask_gunicorn_nginx;
location / {
proxy_pass http://flask_app:8000;
# Do not change this
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
@ivanpanshin
ivanpanshin / nginx.conf
Created April 28, 2020 10:07
Nginx configuration
# Define the user that will own and run the Nginx server
user nginx;
# Define the number of worker processes; recommended value is the number of
# cores that are being used by your server
worker_processes 1;
# Define the location on the file system of the error log, plus the minimum
# severity to log messages for
error_log /var/log/nginx/error.log warn;
# Define the file that will store the process ID of the main NGINX process
pid /var/run/nginx.pid;