Language, never tought.
Deployment of this project requires Docker and Docker Compose to be installed on the server. If not installed, please follow the official documentation (Docker, Docker Compose) to install.
Following files are required to start build, but not included in the repository for security. Please contact the maintainer if you need them.
environments/secret.env
./scripts/deploy.sh
: Build all images and run containers../scripts/shell_to_xxx.sh
: Connect to the selected container's shell.
- Create a MySQL volume by running
docker volume create glossm-mysql-volume
. - Run
./scripts/deploy.sh
. This may requiresudo
. - Type
docker container ls
to confirm that all three containers (glossm-api
,glossm-mysql
, andglossm-nginx
) are running. - To test locally, add the following line to
/etc/hosts
(for Windows,C:\Windows\System32\Drivers\etc\hosts
).
127.0.0.1 api.glossm.com
- Access
http://api.glossm.com/manage
. Voilà!
You need an admin account to access the admin page. Follow the steps below to create one.
$ ./scripts/shell_to_django.sh
/code # source ../venv/bin/activate
(venv) /code # python manage.py createsuperuser
When new Python packages are added to dependencies, you should install them.
$ ./scripts/shell_to_django.sh
/code # source ../venv/bin/activate
(venv) /code # pip install -r requirements.txt
This is automatically done during the initial build.
If something goes wrong, check container logs by typing docker logs CONTAINER_NAME
. Container names are like glossm-xxx
.
If you modify any models.py
files, you need to create migration files and apply them. Follow the steps below.
$ ./scripts/shell_to_django.sh
/code # source ../venv/bin/activate
(venv) /code # python manage.py makemigrations
(venv) /code # python manage.py migrate
Don't forget to add migration files to Git.