This is the official bootstrap repository for running ProtoPie Enterprise using Docker Compose as an on-premises server.
Clone me. Edit me. Use me.
- Docker 1.13.0+
- Docker Compose 1.10.0+
Qty | CPU(core) | Memory | |
---|---|---|---|
Minimum | 1 | 1 core 64bits | 4GB |
Recommended | 1 | 2 cores 64bits | 8GB |
- Storage: Depends on how many prototypes will be saved.
- CentOS 7+
- Debian 9+
- Fedora 28+
- Ubuntu 18.04+
- Windows 10 64bit : Pro, Enterprise or Education (1607 Anniversary Update, Build 14393 or later)
- 10.12+
ProtoPie Enterprise is composed of four services as docker images in Docker Compose.
nginx
web
api
db
Note that please login with your Docker ID via docker login
to pull these docker images from docker hub.
Open the following files, follow the steps below, and edit these files accordingly, before getting ProtoPie Enterprise up and running.
Move the license.pem
file to the same directory as docker-compose.yml
.
The config.yml
file holds the basic configurations of ProtoPie Enterprise. For example,
servers.http
: The URL that ProtoPie Enterprise runs on. (e.g. http://your.domain)mail.smtp
: SMTP configuration to send emails. (e.g. inviting members or changing password.)
The xxx.env
files represent environment variables in the application. db.env
that has two parts of configurations root user
and protopie db
for initial db to create user and database.
Once you have edited the aforementioned files, you are ready to up the docker containers in docker-compose.yml
and run ProtoPie Enterprise. Execute below command to run the containers in the background via docker-compose.
$ docker-compose -p protopie up -d
Then, you can access it at http://your.domain
. If you want to use another port, modify services.nginx.port
in docker-compose.yml
and servers.http
in config.yml
.
Note that db
data will persist even if the container stops or is removed because db
is bind-mounted to the host file system.
Private issued by the SSL certificate issuing authority.You must have a key and a certificate signing file.(.csr) Use the command below.
openssl x509 -req -days 365 -in .csr -signkey .key -out .crt ex => openssl x509 -req -days 365 -in protopie.csr -signkey protopie.key -out protopie.crt
We highly recommend that you use HTTPS for security and safety reasons. If you have a SSL/TLS certificate, insert this configuration into the nginx.conf
file properly.
.
.
.
server {
listen 443;
server_name localhost;
ssl on;
ssl_certificate modify => docker container SSL file path ## /etc/nginx/ssl/protopie.crt;
ssl_certificate_key modify => docker container SSL file path ## /etc/nginx/ssl/protopie.key;
container SSL file path
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
.
.
.
}
Modify the docker-compose.yml file as follows
services:
nginx:
image: nginx:1.21.1-alpine
hostname: ppeop_nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx-html:/usr/share/nginx/html:ro
- local file path : docker container file path ## ex: ./ssl/protopie.key:/etc/nginx/ssl/protopie.key:ro
- local file path : docker container file path ## ex: ./ssl/protopie.crt:/etc/nginx/ssl/protopie.crt:ro
ports:
- 443:443 ## modify =>local port : docker container port
links:
- web
- api
Modify the config.yml file as follows
servers:
http: https://your-domain ## ex : https://protopie.com
update: https://autoupdate.protopie.io
These docker images is based on linux. So if you are on windows, recommend that using Docker for Windows
with hyper-v to run linux container on windows. See below link for the details.
Note that in case of api
, ProtoPie Enterprise may not work well with version downgrading. Because each major or minor version updates may contain changes in the db scheme, every time api
checks it while bootstrapping and api
will try to migrate db if a version update contains changes in the db scheme. Hence, in case of version downgrading, api
might raise an error due to a migrated db scheme.
- enterprise-web-1.0.2 / enterprise-api-1.0.8 (O)
- enterprise-web-1.0.2 / enterprise-api-1.1.2 (X)
As you might have noticed from the docker-compose services name, web
sends requests to api
to get data and shows in page. These are coupled tightly but isolated as a service. Therefore, make sure that web
and api
versions have a matching minor version (not patch version). If the versions are mismatched, requests from web
will return a response with an error message.
Uploaded Pies with images and database data would use the most disk space. It's needed to check for available disk space and create backups in case of unexpected issues. If you want create a backup, see the docker volumes below for what you need to copy.
api_upload
: where a Pie has been uploaded to.
docker cp protopie_api_1:/app/upload [[BACKUP_PATH]]
-
pg_data
: where the database data is stored.docker exec protopie_db_1 pg_dump -c -U protopie_r protopie > [[BACKUP_PATH]]/protopie_db_
date +%y%m%d%H%M%S
.sql
api_upload
: uploaded data is restore
docker cp [[BACKUP_PATH]] protopie_api_1:/app/
ex: docker cp ./upload protopie_api_1:/app/
pg_data
: database data is restore.
cat [[BACKUP_PATH]]/protopie_db_xxx.sql | docker exec -i app_db_1 psql -U protopie_w protopie
-
Navigate to the path of the protopie file in Windows Explorer (e.g.=> (c:\local\lib\protopie)
-
Open the docker-compose.yml file
-
Find, modify, and save the following parts
web:
image: protopie/enterprise-onpremises:web-9.20.0 => image: protopie/enterprise-onpremises:web-10.0.3
api:
image: protopie/enterprise-onpremises:api-9.20.0 => image: protopie/enterprise-onpremises:api-10.0.3
-
Enter "cmd" in window key + r (short key) => Run window
-
Move to cd protopie file path (e.g.=> cd c:\local\lib\protopie )
-
docker-compose stop
-
docker-compose rm (delete service)
-
docker-compose up -d (install and run updated version)
-
Access "protopie URL" from browser (IE, Chrome)
-
cd "moving the path of a protocol file" (e.g.=> cd /home/victor)
-
sudo vi docker-compose.yml (file open)
-
Find, modify, and save the following parts
web:
image: protopie/enterprise-onpremises:web-9.20.0 => image: protopie/enterprise-onpremises:web-10.0.3
api:
image: protopie/enterprise-onpremises:api-9.20.0 => image: protopie/enterprise-onpremises:api-10.0.3
-
$/home/victor docker-compose stop
-
$/home/victor docker-compose rm (delete service)
-
$/home/victor docker-compose up -d (install and run the update version)
-
Connect "protopie URL" from browser (IE, Chrome)
Always make sure that browser cache is cleared(disabled) after applying this trouble shooting guide.
docker logs (postgres:10.5-alphine docker container) "/bin/bash^M: bad interpreter: no such file or directory" error when it occurs
If you use Sublime Text on Windows or Mac to edit your scripts: Click on View > Line Endings > Unix and save the file again.
In notepad++ you can set it for the file specifically by pressing: Edit --> EOL Conversion --> UNIX/OSX Format
Remove the spurious CR characters. You can do it with the following command: sed -i -e 's/\r$//' setup.sh
If you use vi to edit your scripts: vi run.sh :set fileformat=unix
docker-compose protopie restart
docker-compose protopie stop
docker-compose protopie logs
Please check tls
ssl
in config.yml
are false
Update nginx.conf
at line number 45 like below
# FROM
listen 80;
location / {
proxy_pass http://web_server;
}
# TO
listen 80;
location / {
sub_filter_once off;
sub_filter_types text/html;
sub_filter "<meta http-equiv=\"Content-Security-Policy\" content=\"upgrade-insecure-requests\"/>" "";
proxy_pass http://web_server;
}