Skip to content

Commit

Permalink
config: update docker setup so deploy and dev work better together
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Jul 28, 2021
1 parent 848cf3f commit 113ef1a
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 18 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,12 @@ A modern, lightweight learning management system.
The Doubtfire Deploy repository is used to manage releases of Doubtfire using containers.

More details soon...


## How to use this project for development

## How to use this project for releasing new versions

## How to use this project for deployment


60 changes: 48 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.9'
services:
webserver:
container_name: webserver
container_name: df-prod-webserver
build:
context: .
dockerfile: webserver.Dockerfile
Expand All @@ -14,7 +14,7 @@ services:
volumes:
- ./data/student-work:/student-work
pdfgen:
container_name: pdfgen
container_name: df-prod-pdfgen
build:
context: .
dockerfile: pdfgen.Dockerfile
Expand All @@ -25,13 +25,49 @@ services:
volumes:
- ./data/student-work:/student-work
database:
container_name: database
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: db-root-password
MYSQL_DATABASE: doubtfire
MYSQL_USER: dfire
MYSQL_PASSWORD: pwd
volumes:
- ./data/database:/var/lib/mysql
container_name: df-prod-database
image: mariadb
restart: always
environment:
MYSQL_ROOT_PASSWORD: db-root-password
MYSQL_DATABASE: doubtfire-dev
MYSQL_USER: dfire
MYSQL_PASSWORD: pwd
volumes:
- ./data/database:/var/lib/mysql
doubtfire-overseer:
container_name: df-prod-overseer
build:
dockerfile: overseer.Dockerfile
depends_on:
- df-prod-mq
restart: on-failure
environment:
DOCKER_HOST: host.docker.internal
RABBITMQ_HOSTNAME: df-prod-mq
RABBITMQ_USERNAME: secure_credentials
RABBITMQ_PASSWORD: secure_credentials
CONTAINER_NAME: overseer-container
HOST_XFS_VOLUME: $PWD/data/overseer-instances/1

volumes:
# Host path for writing the output of execution - required.
# TODO: Test by mounting an actual XFS volume.
- ./data/overseer-instances/1:/home/overseer/work-dir
# Path for reading OnTrack files from - required.
# TODO: Map this directly to a constant path that can be written to,
# as the path will be a part of the messages
# received from OnTrack via RabbitMQ.
# TODO: Make the path rw by overseer in docker image.
- ./data/student-work:/student-work
doubtfire-mq:
container_name: df-prod-mq
image: rabbitmq:3.8-management
ports:
- 15672:15672
volumes:
- ./data/rabbitmq/data/:/var/lib/rabbitmq
- ./data/rabbitmq/log/:/var/log/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: secure_credentials
RABBITMQ_DEFAULT_PASS: secure_credentials
13 changes: 10 additions & 3 deletions doubtfire-base.env
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ DF_PRODUCTION_DB_PASSWORD=pwd
# Database settings - for development env
DF_DEV_DB_ADAPTER=mysql2
DF_DEV_DB_HOST=database
DF_DEV_DB_DATABASE=doubtfire
DF_DEV_DB_DATABASE=doubtfire-dev
DF_DEV_DB_USERNAME=dfire
DF_DEV_DB_PASSWORD=pwd

Expand Down Expand Up @@ -45,6 +45,13 @@ DF_AAF_ISSUER_URL=https://rapid.test.aaf.edu.au
DF_AAF_AUDIENCE_URL=http://localhost:3000
DF_AAF_CALLBACK_URL=http://localhost:3000/api/auth/jwt
DF_AAF_IDENTITY_PROVIDER_URL=https://signon-uat.deakin.edu.au/idp/shibboleth
DF_AAF_UNIQUE_URL=https://rapid.test.aaf.edu.au/jwt/authnrequest/research/Ag4EJJhjf0zXHqlKvKZEbg
DF_AAF_UNIQUE_URL=https://rapid.test.aaf.edu.au/jwt/authnrequest/research/of-UrEaRtaGds22mccqh6w
#https://rapid.test.aaf.edu.au/jwt/authnrequest/research/Ag4EJJhjf0zXHqlKvKZEbg
DF_AAF_AUTH_SIGNOUT_URL=https://sync-uat.deakin.edu.au/auth/logout
DF_SECRET_KEY_AAF=v4~LMFLzzwRGZdju\5QBa@FiHIN9
DF_SECRET_KEY_AAF=v4~LMFLzzwRGZdju\5QBa@FiHIN9

# Overseer
OVERSEER_ENABLED=1
RABBITMQ_HOSTNAME=df-prod-mq
RABBITMQ_USERNAME=secure_credentials
RABBITMQ_PASSWORD=secure_credentials
11 changes: 8 additions & 3 deletions pdfgen.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,21 @@ RUN apt-get update && apt-get install -y \
# Setup the folder where we will deploy the code
WORKDIR /doubtfire

# Copy doubtfire-api source
COPY "$API_HOME" /doubtfire/

# Install LaTex
COPY "$API_HOME"/.ci-setup /doubtfire/.ci-setup
RUN /doubtfire/.ci-setup/texlive-install.sh

# Install bundler
RUN gem install bundler

# Install the Gems
COPY "$API_HOME"/Gemfile "$API_HOME"/Gemfile.lock /doubtfire/
RUN bundle install --without passenger webserver

# Setup path
ENV PATH /tmp/texlive/bin/x86_64-linux:$PATH

# Copy doubtfire-api source
COPY "$API_HOME" /doubtfire/

CMD bundle exec rake submission:generate_pdfs
3 changes: 3 additions & 0 deletions webserver.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ COPY "$API_HOME" /doubtfire/
# Copy doubtfire-web dist
COPY "$WEB_HOME/dist" /doubtfire/public/

# Install bundler
RUN gem install bundler

# Install the Gems
RUN bundle install --without passenger

Expand Down

0 comments on commit 113ef1a

Please sign in to comment.