Entire Atmosphere development environment in Docker Containers using Docker-Compose.
-
Clone this repository in the same directory as Troposphere, Atmosphere, and Atmosphere Ansible repositories (these must be present for this to work properly)
- Alternatively, modify the docker-compose file to point to your local repositories with either relative or absolute paths
-
atmosphere-docker.sh pull
to pull all containers- To populate with an existing Atmosphere database, copy the
*.sql
file to thepostgres
directory - To populate with a Troposphere database, copy the
tropo*.sql.dump
file to thepostgres
directory. If the file is a*.sql
file, the postgres image will attempt to dump it into the Atmosphere database instead of the Troposphere database
- To populate with an existing Atmosphere database, copy the
-
Clone the
atmosphere-docker-secrets
repository in the same directory as this repository (not inside this repository directory)- Checkout branch with the correct variables for your environment
- Use the script
mock_user.sh <your_cyverse_username>
to changeMOCK_USER
variable inatmosphere.ini
andtroposphere.ini
to your username if using 'local' variables branch
-
atmosphere-docker.sh up
to start all containers (use the-d
option to run containers in the background)- The container's entrypoint will automatically read a variable from the
env
file inatmosphere-docker-secrets
to determine if running a production or development environment - If you are using a local development version and want Guacamole also, replace the
atmosphere-docker.sh
part of all commands with:atmosphere-docker.sh -f docker-compose.yml -f docker-compose.guac.yml
- If using local development version:
- IMPORTANT: If you are using Linux and want to maintain ownership of your local repositories, edit the
command
lines indocker-compose.yml
with your user id (useid -u
to get this). User ID1000
is the default - Your containers should be ready when you see
webpack: Compiled successfully.
from Troposphere andStarting Django Python...
from Atmosphere - Access Atmosphere in your browser at
localhost
- Troposphere and Atmosphere changes will be automatically built
- IMPORTANT: If you are using Linux and want to maintain ownership of your local repositories, edit the
- The container's entrypoint will automatically read a variable from the
NOTE: Since this directly uses your local directories for Atmosphere, Troposphere, and Atmosphere-Ansible, these directories will be modified to have things like updated settings files, *.pyc
files and others present in the .gitignore
files. To clean up your directory and delete all files recognized by gitignore, run git clean -fdx
Variables ini files in atmosphere-docker-secrets are linked to the files used by Atmosphere, Troposphere, and Atmosphere-Ansible so you can easily modify those files locally and have them accessible by the services that use them. Easily re-run the configure scripts with these commands:
# Configure Troposphere
docker exec -ti $(docker ps -f name=troposphere --format "{{.Names}}") /opt/env/troposphere/bin/python configure
# Configure Atmosphere
docker exec -ti $(docker ps -f name=atmosphere_ --format "{{.Names}}") /opt/env/atmosphere/bin/python configure
# Configure Atmosphere-Ansible
docker exec -ti $(docker ps -f name=atmosphere_ --format "{{.Names}}") /opt/env/atmosphere/bin/python /opt/dev/atmosphere-ansible/configure
# Access Atmosphere Django shell
docker exec -ti $(docker ps -f name=atmosphere_ --format "{{.Names}}") /opt/env/atmo/bin/python manage.py shell
Gracefully shut down containers with Ctrl+c
. Press it again to kill containers.
Or kill all containers with atmosphere-docker.sh kill
.
Delete all containers when you are done with atmosphere-docker.sh rm
.
Delete all unattached volumes with docker volume prune
.
NOTE: When the logs/
directory is created by Docker Compose it will be owned by root so you cannot delete it without sudo
. However, rm -rf logs
will delete all of the files but the directory structure will remain. If you create the logs directory before running the containers, you can easily delete it.