-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprovision-docker.sh
52 lines (45 loc) · 1.3 KB
/
provision-docker.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# Polemarch server configuration (Ubuntu 20.04) running on Docker
#
# Considerations
# =================
# - This script is intended to be run on a fresh Ubuntu 20.04 server.
# - It will create all the necessary files and directories for Polemarch.
# - It will start the polemarch server as ROOT
#
# Architecture
# ============
# - Polemarch is installed in a virtualenv
# - The virtualenv is located in /opt/polemarch
# - The database is a sqlite (default) database
## Create virtualenv
# For Debian 10 use python3.7
# For rhel/centos7 use python3.6
# In some cases use sudo for first command.
virtualenv --python=python3.8 /opt/polemarch
sudo mkdir -p /etc/polemarch
source /opt/polemarch/bin/activate
# Install polemarch
pip install tzdata
pip install -U polemarch==1.8.5
# Create additional directories
mkdir /opt/polemarch/logs /opt/polemarch/pid
mkdir /projects
mkdir /hooks
# Create config at /etc/polmarch/settings.ini
# See https://polemarch.readthedocs.io/en/latest/installation.html#configuration
cat <<EOF > /etc/polemarch/settings.ini
[main]
projects_dir = /projects
hooks_dir = /hooks
[uwsgi]
pidfile = /run/web.pid
addrport = 0.0.0.0:8080
vacuum = True
max-requests = 1000
max-worker-lifetime = 3600
worker-reload-mercy = 60
http-keepalive = true
http-auto-chunked = true
thread-stacksize = 1024
EOF