This file contains 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
# schema.sql transforms | |
s/\[n?(var)?char\]\((max|\d+)\)/TEXT/ | |
s/\[(small|big|tiny)?int\]/INTEGER/ | |
s/\[bit\]/BOOLEAN/ | |
s/\[datetime\]/DATETIME/ | |
s/\[(var)?binary\]\((max|\d+)\)/BLOB/ | |
s/^\t\[([^\]]+)\]/\t\1/ | |
s/IDENTITY\(\d+,\d+\) // | |
s/CONSTRAINT \[[^\]]+\] PRIMARY KEY CLUSTERED \n\(([^\)]+)\)/PRIMARY KEY (\1) / | |
s/ ASC,?\n\t?/, / |
This file contains 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
# Be aware to first setup a valid Python 3 environment with the proper requirements installed. | |
# Also activate your Python installation/venv before executing those commands. | |
VER=0.19.4 | |
PROGS?=app1 app2 app3 app4 | |
PROGS_PY:=$(addsuffix .py,$(PROGS)) | |
PROGS_EXE:=$(addsuffix .exe,$(PROGS)) |
This file contains 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
[Unit] | |
Description=uWSGI instance to serve app | |
After=network.target | |
[Service] | |
{# ExecStartPre=/bin/mkdir -p /run/uwsgi #} | |
{# ExecStartPre=/bin/chown www-data:www-data /run/uwsgi #} | |
User=root | |
Group=root | |
WorkingDirectory=/var/www/app |
This file contains 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
[uwsgi] | |
# application's base folder | |
appname = app | |
base = /var/www/app | |
# python module to import | |
app = app | |
module = %(app) | |
chdir = %(base) |
This file contains 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
server { | |
listen 80; | |
server_name {{ ansible_host }}; | |
charset utf-8; | |
client_max_body_size 75M; | |
location / { try_files $uri @app; } | |
location @app { | |
include uwsgi_params; | |
uwsgi_pass unix:/run/uwsgi/app/app/socket; |
This file contains 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
--- | |
- hosts: [www] | |
tasks: | |
- name: update apk | |
apk: | |
update_cache: yes | |
- name: upgrade alpine | |
apk: | |
upgrade: yes | |
tags: |