Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prod docker containers #93

Merged
merged 52 commits into from
Nov 27, 2023
Merged

Prod docker containers #93

merged 52 commits into from
Nov 27, 2023

Conversation

danakim
Copy link
Contributor

@danakim danakim commented Apr 18, 2023

@danakim danakim requested a review from quartje April 18, 2023 12:16
Copy link
Contributor

@quartje quartje left a comment

Choose a reason for hiding this comment

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

Nice work! Good to see that many concepts we discussed end up in this PR.
I've added some remarks in the code. I will also do some testing locally, to see if we can actually get something up & running.

php72 + FPM -> PHP 8.x + apache module is something we need yet to discuss

build-push-docker-image:
runs-on: ubuntu-latest
permissions:
packages: write
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool! I did not know this feature yet

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Glad you find it useful :)

ghcr.io/openconext/stepup-webauthn/stepup-webauthn:prod
ghcr.io/openconext/stepup-webauthn/stepup-webauthn:${{ github.sha }}

- name: Build and push the Development image
Copy link
Contributor

Choose a reason for hiding this comment

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

For discussion: If all php dev images are the same (apache + php + xdebug) we might publish one container to rule them all in the basecontainers project

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! I like this proposal that we also discussed in today's meeting. I suggest we take a look at the end, if all the applications are very similar, this might be very useful.

FROM ghcr.io/openconext/openconext-basecontainers/php72-fpm-apache2:latest
ENV SYMFONY_ENV=prod
RUN rm -rf /var/www/html/*
COPY --from=php-build /var/www/html/archive.tar /var/www/html
Copy link
Contributor

Choose a reason for hiding this comment

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

Nico optimization, this beats specifying all dirs from the build container

Copy link
Contributor Author

Choose a reason for hiding this comment

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

\o/ Glad you like it!

@@ -0,0 +1,31 @@
<Virtualhost *:80>
ServerName webauthn
Copy link
Contributor

Choose a reason for hiding this comment

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

Thought for a later time: We could base the servername on a provided env_var

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very true! Like we discussed, we might make a shared config template based on env vars. And for "hostname" specifically, it could be generic (I think it accepts "*" or something like that, need to remember and look it up).

[www]
;Logs can be sent to stdout / err or to a file
;access.log = /proc/self/fd/2
access.log = /usr/local/var/log/php-fpm-access.log
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's leave it out. I don't like files in containers, they tend to be deleted.

Also, docker(-compose) logs provides a more standardized way to get your logs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmmm, I added this specifically to make the tail -f command from the start script easier to read: it now follows both the apache and the php-fpm logs and it adds that nice header to tell you from which log (and daemon) the messages are coming from.

Check it out, try to use it and see how you like it. If you still think it is a bad idea after that, we can remove it and find another way.

@quartje quartje force-pushed the prod-docker-containers branch 2 times, most recently from d3ebca7 to f4ccdda Compare April 20, 2023 08:58
@quartje
Copy link
Contributor

quartje commented May 23, 2023

I have rebased this branch on the docker_config branch so that we can test the build.
I propose some rebasing once everything works so we can rewrite the commit history.

@MKodde MKodde force-pushed the prod-docker-containers branch from a50fa2a to 01bd6a0 Compare June 6, 2023 06:17
@MKodde
Copy link
Member

MKodde commented Jun 6, 2023

Hi @danakim, I've taken the liberty to rebase your PR onto my JS/PHP dependency updates PR. That way, this PR should start getting some ✔️

@MKodde MKodde changed the base branch from develop to feature/dependency-updates June 6, 2023 06:19
@quartje quartje force-pushed the prod-docker-containers branch from c4452fe to 324dac6 Compare June 7, 2023 18:23
@danakim
Copy link
Contributor Author

danakim commented Jun 8, 2023

@MKodde - thanks for this! I like seeing those green check marks :D

Base automatically changed from feature/dependency-updates to develop June 12, 2023 11:46
@phavekes phavekes force-pushed the develop branch 4 times, most recently from b817a6a to 4e936d9 Compare July 10, 2023 06:20
quartje and others added 27 commits November 27, 2023 14:20
The development environment is being ported to Docker. To allow
different containers work seamless together, all apps will contain a
default configuration that works with the configuration in other
containers. Shared config and key material is fetched from the
OpenConext-devconf repository.
Before with PHP-FPM we did not need to do a "require all granted" within
<Location> tags. With Apache as a module we do need it.
This duplicates what's happening in OpenConext-devconf
We utilize the Github Dependabot integration for security checking.
We utilize the Github Dependabot integration for security checking.
The gesture (buttonpress) is no longer required to start the WebAuthn
session with the browser. This is a revert of the original behavior. But
the button remained on the page for users of an old unsupportive
browser.

See https://www.pivotaltracker.com/story/show/184695105
This will let the logs go to stdout when running as a container, which
is the Docker way to send logs
@MKodde MKodde force-pushed the prod-docker-containers branch from f242a37 to d1661fa Compare November 27, 2023 13:20
@MKodde MKodde merged commit 8cd1ff2 into develop Nov 27, 2023
1 check failed
@MKodde MKodde deleted the prod-docker-containers branch November 27, 2023 13:20
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