Skip to content

Commit

Permalink
Add back the logic to mount ood_portal.yml into container and run upd…
Browse files Browse the repository at this point in the history
…ate_ood_portal during launch
  • Loading branch information
treydock committed Dec 25, 2020
1 parent 6fd2e6a commit 53e6874
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
5 changes: 0 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ RUN source /opt/rh/ondemand/enable && \
RUN mkdir -p /etc/ood/config
RUN cp /opt/ood/nginx_stage/share/nginx_stage_example.yml /etc/ood/config/nginx_stage.yml
RUN cp /opt/ood/ood-portal-generator/share/ood_portal_example.yml /etc/ood/config/ood_portal.yml
RUN sed -i -r \
-e 's/^#listen_addr_port:.*/listen_addr_port: 8080/g' \
-e 's/^#port:.*/port: 8080/g' \
-e 's/^#servername:.*/servername: localhost/g' \
/etc/ood/config/ood_portal.yml

# make some misc directories & files
RUN mkdir -p /var/lib/ondemand-nginx/config/apps/{sys,dev,usr}
Expand Down
1 change: 1 addition & 0 deletions docker/launch-ood
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@

set -e

/opt/ood/ood-portal-generator/sbin/update_ood_portal
runuser -u ondemand-dex /usr/sbin/ondemand-dex serve /etc/ood/dex/config.yaml &
/usr/sbin/httpd -DFOREGROUND
8 changes: 8 additions & 0 deletions docker/ood_portal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
#
# Portal configuration
#

listen_addr_port: 8080
servername: localhost
port: 8080
6 changes: 5 additions & 1 deletion lib/tasks/docker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@

desc "Run Docker container"
task :run do
sh "#{container_runtime} run -p 8080:8080 -p 5556:5556 -v '#{PROJ_DIR}:/ondemand' --name #{DOCKER_NAME} --rm --detach #{DOCKER_NAME}:latest"
args = [ container_runtime, 'run', '-p 8080:8080', '-p 5556:5556', "--name #{DOCKER_NAME}" ]
args.concat [ "--rm", "--detach", "-v '#{PROJ_DIR}:/ondemand'" ]
args.concat mount_args
args.concat [ "#{DOCKER_NAME}:latest" ]
sh args.join(' ')
end

desc "Kill Docker container"
Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def stop_test_container
end

def mount_args
[]
["-v", "#{PROJ_DIR.join('docker', 'ood_portal.yml')}:/etc/ood/config/ood_portal.yml:ro"]
end

def rt_specific_flags
Expand Down

0 comments on commit 53e6874

Please sign in to comment.