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

Docker #6

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Docker #6

wants to merge 21 commits into from

Commits on Aug 20, 2024

  1. Remove -x settings from siikr.conf

    siikr.conf should probably be treated as a configuration or env file, so
    it should not have execute permissions. It should only be invoked by
    using `source` in your shell.
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    756708b View commit details
    Browse the repository at this point in the history
  2. docker: add Dockerfile and supervisord.conf

    The Dockerfile tries to emulate the simple_setup.sh script as closely as
    possible. A couple of quirks:
    
    * php-zmq does not appear to have a Debian package, and the package on
      PECL is from 2016 and the repo has been abandoned. Instead, we need to
      compile it from source. Not a huge deal, but still annoying.
    * Since the msgrouter service can't really run in Docker (since it uses
      systemd services) I have opted to use supervisord. See here:
      https://docs.docker.com/config/containers/multi-service_container/
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    2ef6883 View commit details
    Browse the repository at this point in the history
  3. docker: Rename siikr.conf -> siikr.example.env

    Since siikr.conf is more of an environment file, the extension should
    reflect that. I have also renamed it to siikr.example.env - this is so
    that if the configuation is changed, it will only go into the example
    env file, and not cause issues with pulling down into a modified
    siikr.env file. Additionally, it helps prevent in-dev configuration from
    accidentally getting committed in the case that someone uses
    `git commit -a` a bit carelessly.
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    0065b7d View commit details
    Browse the repository at this point in the history
  4. Move Dockerfile -> docker/php-fpm.Dockerfile, and add DB configuratio…

    …n step to php-fpm.Dockerfile
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    8b95507 View commit details
    Browse the repository at this point in the history
  5. Add docker-compose, postgres.Dockerfile, create_database.sh script, a…

    …nd update README + env example
    
    * docker-compose.yaml for docker-compose command
    * postgres.Dockerfile sets up Postgres appropriately
    * create_database.sh script will create the Postgres database from the
      SQL in the siikr directory in the Docker container
    * README includes base instructions for using docker-compose
    * Update siikr.example.env to include the POSTGRES_* environment
      variables necessary for Docker deployment
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    01bdc9e View commit details
    Browse the repository at this point in the history
  6. Add siikr.env to root .gitignore

    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    f422ea5 View commit details
    Browse the repository at this point in the history
  7. docker: Add DB host configuration and get_db() function

    * DB host was not previously available in the user configuration, this
      is now added in case your DB is hosted anywhere besides localhost (as
      is the case with Docker)
    * All of the `new PDO` calls were either using a hard-coded database
      user or getting the currently logged in UNIX user, rather than the
      configured user. The password was also being set to null. This is
      resolved with the `get_db()` function in the internal/globals.php
      file. All calls to `new PDO` are also updated so we don't have to
      update it in 6 different places, either.
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    4c666e0 View commit details
    Browse the repository at this point in the history
  8. Add postgres_data/ directory to .gitignore

    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    b5a8309 View commit details
    Browse the repository at this point in the history
  9. docker: Add nginx to the PHP FPM container

    * Forward port 80 -> 8080
    * Install nginx in php container
    * Add a php-fpm-siikr.conf file for Docker
    * Add an nginx-siikr.conf file Docker
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    0e2d88e View commit details
    Browse the repository at this point in the history
  10. Add siikr/internal/disks.php file creation to php-fpm.Dockerfile

    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    3636659 View commit details
    Browse the repository at this point in the history
  11. Fix a couple of small bugs in index.php and show_page.php

    * Use `isset` on the $_GET key, instead of checking for implicit
      membership
    * Add a catch for `DivisionByZeroError` in the show_page.php - not sure
      why the `catch (Exception $e)` wasn't catching it. (We can fix it
      later)
    
    Signed-off-by: Alek Ratzloff <[email protected]>
    alekratz authored and meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    d1a5266 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    c0d575b View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    734c0ed View commit details
    Browse the repository at this point in the history
  14. One quick doc line

    meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    548cab5 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    7950608 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    0ecd316 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    155aabd View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    bb12812 View commit details
    Browse the repository at this point in the history
  19. Fixed extension installs

    meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    4919abf View commit details
    Browse the repository at this point in the history
  20. Fixing get_db()

    meyerkev committed Aug 20, 2024
    Configuration menu
    Copy the full SHA
    6c7fb2f View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    598d13c View commit details
    Browse the repository at this point in the history