This is our application, which I've containerized for easier development. Included are containers for:
- The PHP/Apache server
- The MySQL database
- PHPMyAdmin for the database
- and the report generation API (as soon as the API is created)
I do not currently have a deployment command, but I aim to create a script to be able to deploy the server by next week.
This requires:
- Docker engine AND docker compose to be installed. Docker Install
- CPanel This also requires you to have the cPanel server private keys added. ABET Private Key
- A bash command line. (a given)
Once that's done, you can run these commands to view the application
- cd into
docker/and create a.envfile in that folder.env.demois a format file that you can use. Please use this for development. More info about .env files - within
docker/, rundocker compose up --build - you can visit localhost port 8080 to see the interface
- you can visit localhost port 8081 to use phpMyAdmin
Using the CPanel
- download abet ssh key from the CPanel
- Set correct permissions:
chmod 600 abet - Move it to a convenient spot. usually
.ssh/ eval "$(ssh-agent -s)"ssh-add $PATH_TO_ABET_PRIVATE_KEY- Use the ABET ssh key password in the discord.
Note: you can automate step 4 and 5 if you create your own private key and put these commands in your ~/.bashrc
You should follow official Docker installation. You got this. Installing Docker Desktop is the easiest way, regardless of OS.
Docker desktop (Installs both!)
everything in docker/ refers to the current containers that we have in the application. If we want more, we should add a folder with the container name, and a docker-compose.yaml.
app container: a php-apache container that runs both php and apache. Apache config is in docker/apache2, but you need to copy this from the server.
mysql container: the container containing the mysql instance and whose database is in ./docker/mysql/mysql_data
if we want to integrate the python file, we can easily create a fastapi container in the docker-compose.
The rest of the project organization info is HERE in the docs
this is the MOST important concept of configuration in the project. On first setup, you probably run cp env.demo .env, but you don't really know what that does. docker/.env stores all of the filled environment variables, and is used by docker-compose.yml which then may set the environment variables of the containers to those values.
.env stores ALL of our secret keys, but also our configuratoin information. Changing .env will change how the containers are built. I made env.demo with the purpose of easy setup, but these values should NEVER be exposed or used in the real server.
Updating mysql tables requires a reset of the ./docker/mysql/mysql_data directory. To update the mysql tables, I usually run:
within the docker/ folder
docker compose down # or docker-compse if you have that
rm -rf ./mysql/mysql_data # reset mysql_data so that tables can be updated.
docker compose up --buildNOTE: copy_from_server.bash does not currently sync everything up, as we have not fully adopted this method. abet_private is copied into src/abet_private/abet_private and abet.asucapstonetools.com is copied into src/public/abet.asucapstonetools.com
- git clone this repo.
- cd into
scripts/and runcopy_from_server.bash- I hardcoded the server IP, so we might need to change this if the step doesn't work
- The script also assumes you're in
scripts/, else it will copy the files to who knows where.
- git add, commit, and push your changes
More docs are located in the docs directory. More information is found in this master document.