Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ services:

before_install:
- pip install --upgrade docker-compose
- cd rcamp
- docker build -t dev/rcamp --build-arg UWSGI_UID=$(id -u) --build-arg UWSGI_GID=$(id -u) .
- cd ..
- export UWSGI_UID=$(id -u)
- export UWSGI_GID=$(id -u)
- export RCAMP_PORT=9000
- docker-compose -f docker-compose.yml -f docker-compose.test-backends.yml -f docker-compose.dev.yml build
- docker-compose -f docker-compose.yml -f docker-compose.test-backends.yml -f docker-compose.dev.yml run --rm --service-ports rcamp-uwsgi bash -c 'sleep 30s && python manage.py migrate'
- docker-compose -f docker-compose.yml -f docker-compose.test-backends.yml -f docker-compose.dev.yml run --rm --service-ports rcamp-uwsgi bash -c 'python manage.py test'
- export HOSTNAME=localhost
- docker build -t dev/rcamp --build-arg UWSGI_UID=$UWSGI_UID --build-arg UWSGI_GID=$UWSGI_GID rcamp/
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.test-backends.yml build
- docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.test-backends.yml run --rm --service-ports rcamp-uwsgi bash -c 'sleep 30s && python manage.py migrate'
- travis_retry docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.test-backends.yml run --rm --service-ports rcamp-uwsgi bash -c 'python manage.py test'

install: true
script: true
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ version: "3.6"
services:
rcamp-uwsgi:
build:
context: rcamp
cache_from:
- dev/rcamp
context: ./rcamp
dockerfile: Dockerfile.test
command: ["python", "manage.py", "runserver", "0.0.0.0:9000"]
environment:
- RCAMP_DEBUG=True
volumes:
Expand Down
19 changes: 0 additions & 19 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,3 @@ services:
- /var/lib/sss/pipes:/var/lib/sss/pipes:rw
- /etc/nsswitch.conf:/etc/nsswitch.conf
- /etc/pam.d:/etc/pam.d

nginx:
hostname: ${HOSTNAME}
image: nginx:stable
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/uwsgi_params:/etc/nginx/uwsgi_params:ro
- ./certs:/etc/nginx/certs:ro
- static-content:/var/www/static:ro
- media-uploads:/var/www/media:ro
- nginx-logs:/var/logs/nginx
ports:
- "80:80"
- "443:443"
depends_on:
- rcamp-uwsgi

volumes:
nginx-logs:
28 changes: 14 additions & 14 deletions docker-compose.test-backends.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
version: "3.6"

services:
nginx:
test-mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=rcamp1712
volumes:
- certs:/etc/nginx/certs:ro
depends_on:
- cert-gen
- ./db:/var/lib/mysql

test-ldap:
image: researchcomputing/rc-test-ldap
# build: ldap

cert-gen:
build:
Expand All @@ -16,17 +22,11 @@ services:
volumes:
- certs:/home/root/certs

test-mysql:
image: mysql:5.7
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=rcamp1712
nginx:
volumes:
- ./db:/var/lib/mysql

test-ldap:
image: researchcomputing/rc-test-ldap
# build: ldap
- certs:/etc/nginx/certs:ro
depends_on:
- cert-gen

volumes:
certs:
21 changes: 20 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ version: "3.6"
services:
rcamp-uwsgi:
build:
context: rcamp
context: ./rcamp
args:
- UWSGI_UID=${UWSGI_UID}
- UWSGI_GID=${UWSGI_GID}
container_name: rcamp-uwsgi
environment:
- RCAMP_UCB_LDAP_URI=${RCAMP_UCB_LDAP_URI}
- RCAMP_UCB_LDAP_USER=${RCAMP_UCB_LDAP_USER}
Expand All @@ -19,7 +20,25 @@ services:
- media-uploads:/home/uwsgi/rcamp/media
- rcamp-logs:/home/uwsgi/rcamp/logs

nginx:
hostname: ${HOSTNAME}
image: nginx:stable
container_name: nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
- ./nginx/uwsgi_params:/etc/nginx/uwsgi_params:ro
- ./certs:/etc/nginx/certs:ro
- static-content:/var/www/static:ro
- media-uploads:/var/www/media:ro
- nginx-logs:/var/logs/nginx
ports:
- "80:80"
- "443:443"
depends_on:
- rcamp-uwsgi

volumes:
static-content:
media-uploads:
rcamp-logs:
nginx-logs:
2 changes: 0 additions & 2 deletions rcamp/Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,3 @@ RUN useradd -M -p $(echo password | openssl passwd -1 -stdin) testuser1 && \
useradd -M -p $(echo password | openssl passwd -1 -stdin) testuser2

WORKDIR /home/uwsgi/rcamp

CMD ["python","manage.py","runserver","0.0.0.0:9000"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions scripts/rebuild-rcamp-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

export RCAMP_PORT=9000
export HOSTNAME=localhost
export UWSGI_UID=$(id -u)
export UWSGI_GID=$(id -u)

cd $1
docker build -t dev/rcamp --build-arg UWSGI_UID=$UWSGI_UID --build-arg UWSGI_GID=$UWSGI_GID rcamp/
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.test-backends.yml down --remove-orphans
cd $1
docker-compose -f docker-compose.yml -f docker-compose.dev.yml -f docker-compose.test-backends.yml build