It’s common to use webapp.io to run QA processes against a full stack including open-source databases.
FROM vm/ubuntu:18.04 # install the latest version of Docker, as in the official Docker installation tutorial. RUN apt-get update && \ apt-get install ca-certificates curl gnupg lsb-release && \ sudo mkdir -p /etc/apt/keyrings && \ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" |\ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null && \ apt-get update && \ apt-get install docker-ce docker-ce-cli containerd.io python3 python3-pip awscli # install docker compose (easily starts required docker containers) RUN curl -L "https://github.com/docker/compose/releases/download/1.26.2/docker-compose-$(uname -s)-$(uname -m)" \ -o /usr/local/bin/docker-compose # copy files from the repository into this staging server COPY . . # start everything - RUN REPEATABLE is a performance improvement that restores the cache from the last time this step ran. RUN REPEATABLE compose up -d --build --force-recreate --remove-orphans db redis # run migrations RUN docker-compose run web python3 manage.py migrate # download anonymized prod data dump SECRET ENV AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION RUN aws s3 cp s3://staging_db_dumps/staging.sql /tmp/staging.sql RUN cat /tmp/staging.sql | docker-compose exec -T db psql
EXPOSE WEBSITE