Skip to content

Conversation

@taniwallach
Copy link
Member

@taniwallach taniwallach commented Jun 10, 2021

Docker improvements:

  1. Add files for a 2 stage Docker build process.
  2. Set things up so Apache gets stopped "gracefully" (current requests get completed).
  1. Also some minor fixes.

2 stage build process

# cd into webwork2 directory (as usual)
docker build --tag webwork-base:forWW216 -f DockerfileStage1 .
vim docker-compose.yml
# uncomment the line
#    dockerfile: DockerfileStage2
docker-compose build

The first stage does all the OS level work, and involves installing several hundred ubuntu packages (and some CPAN Perl packages), so takes quite some time.
The second stage installs WeBWorK, and is relatively fast.


Force rebuild of OS later

# cd into webwork2 directory (as usual)
docker build --no-cache --tag webwork-base:forWW216 -f DockerfileStage1 .

Modify startup so that
	docker container exec -it webwork2_app_1 /usr/sbin/apachectl graceful
can be used to restart Apache in the container in a "nice" way without
stopping the running container.
Minor fixes.
Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good. I have tested the build steps and it works. There is an issue with the permissions on htdocs/tmp with the default build that needs to be resolved.

@mgage
Copy link
Member

mgage commented Jul 3, 2021

the htdocs/tmp permission issue is addressed in my upcoming pull request to patch the 2 stage docker process.

@drgrice1
Copy link
Member

drgrice1 commented Jul 3, 2021

the htdocs/tmp permission issue is addressed in my upcoming pull request to patch the 2 stage docker process.

I see that. I see that you did it without the recursive flag as suggested.

@taniwallach
Copy link
Member Author

taniwallach commented Jul 5, 2021

Note: this PR does not fix the sed code for creating site.conf which no longer properly sets the database password, as the site.conf.dist was fixed in #1399 to use single quotes on the password, but docker-config/docker-entrypoint.sh was not yet fixed to handle that change. That is among the several things fixed in #1423.

@drgrice1
Copy link
Member

drgrice1 commented Jul 5, 2021

I will go ahead and merge this unless someone objects. It only affects the docker build, and seems to work well for that aside from the mentioned issues that are fixed in @mgage's pull request.

@mgage
Copy link
Member

mgage commented Jul 5, 2021

I'm in favor of merging this PR. It will make it easier for me to organize the additional minor changes I'd like to add.

@drgrice1 drgrice1 merged commit cc53b94 into openwebwork:WeBWorK-2.16 Jul 5, 2021
drgrice1 added a commit that referenced this pull request Jul 5, 2021
…graceful-restart

Add support for a 2 stage Docker build process + support graceful Apache restart
@taniwallach taniwallach deleted the docker-two-stage-and-allow-graceful-restart branch July 14, 2021 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants