- OS
- Ubuntu 20.04 LTS
- Memory
- Minimal: 1 GB
- Suggest: 2+ GB
- Disk
- Minimal: 512 MB
- Suggest: 16+ GB
- docker 20.10
- docker-compose 1.29
- (Optional) nginx 1.18
- (Optional) certbot 1.26.0
- clone project
git clone https://github.com/ywChen-NTUST/MyMBS.git
cd MyMBS/- prepare an image for administrator account and save it in
www/profile_photowith prefix 01_
www
|- profile_photo
|- 01_<administrator_profile_photo>
- copy
.env.templateto.envand modify it
cp .env.template .env
# modify .env
## for ADMIN_PROFILE, place the image name which you store in www/profile_photo (i.e. 01_administrator.jpg)- change owner of the
www/attachments/andwww/profile_photo/directory towww-data
chown www-data:www-data www/profile_photo/
chown www-data:www-data www/attachments/- run container
docker-compose up -d --build-
(Optional) Setup domain name
-
copy
config/mymbs_nginx.conf.exampletoconfig/mymbs_nginx.confand modifycp config/mymbs_nginx.conf.example config/mymbs_nginx.conf # modify config/mymbs_nginx.confBasicly, only needs to modify
server_nameto your domain name -
copy file
cp config/mymbs_nginx.conf /etc/nginx/sites-enabled/
-
(Optional) hide server information
Goto
/etc/nginx/nginx.confand uncomment line 22:server_tokens off; -
restart nginx
service nginx restart
-
-
(Optional) Setup SSL
certbot --nginxuser data is stored under these directory:
db/persistwww/profile_photowww/attachments
if you want to preserve to another server, fellowing these steps:
-
login into your new server and goto the project dir
-
cleaning the old data (if you haven't build the system before, no needs to do this step)
rm -rf db/persist/
rm -rf www/attachments
rm -rf www/profile_photo- copy files
scp -r <old_server_username>@<old_server_ip>:<project_dir>/db/persist ./db/
scp -r <old_server_username>@<old_server_ip>:<project_dir>/www/profile_photo ./www/
scp -r <old_server_username>@<old_server_ip>:<project_dir>/www/attachments ./www/- change owner of the
www/attachments/andwww/profile_photo/directory towww-data
chown www-data:www-data www/profile_photo/
chown www-data:www-data www/attachments/- rebuild containers
docker-compose up -d --build