Welcome to SmartCinemaProject
Our fancy badge collection
Sonarqube
Docker
GitHub
Continuous Integration
Project Health
How To Run
The SmartCinema server components are available in a docker container. We only have one container where
all server programs are installed, but you can start it in various ways to run a single component only.
Quick Start
Run the web app with an integrated API server
docker run -d --name=smartcinema -p 8080:8080 smartcinema/smartcinema
You can then view the web app at http://localhost:8080/
Since the database is empty, you might want to run the data scraper to fill
the database with movies and cinemas:
docker run -it --rm --link smartcinema:api --shm-size 2g smartcinema/smartcinema smartcinema-scraper
(The --shm-size
is necessary otherwise the included firefox will crash)
Proper Deployment
In a real-world situation, you would want to run the API server and web app in different containers,
and you'd want to make sure that the database is persistent:
So here's how you start the API alone:
docker run -d --name=smartcinema-api -p 9090:9090 -v /INSERT/DATABASE/DIRECTORY/ON/HOST/HERE:/home/smartcinema/db smartcinema/smartcinema smartcinema-api
Make sure the database directory is accessible by the user in the container (UID 1000).
And the web app:
docker run -d --name=smartcinema-web -p 8080:8080 --link smartcinema-api:api smartcinema/smartcinema smartcinema-web
The scraper is supposed to be started via a cron job, and you can run it as follows:
docker run -it --rm --link smartcinema-api:api --shm-size 2g smartcinema/smartcinema smartcinema-scraper
While the web app contains a poor man's proxy for the REST API, you'll want to
configure your reverse proxy (you're using one for TLS termination anyway, right?)
to handle this. Here's a relevant nginx snippet:
location / {
proxy_pass http://127.0.0.1:8080/;
}
location /rest/ {
proxy_pass http://127.0.0.1:9090/rest/;
}