Skip to content

Enable Nginx Environment-Aware Docker Builds with GitHub Actions Integration #76

Description

@MartinPaulEve

Summary

Update the Docker build process and GitHub Actions workflow to ensure environment awareness, so Nginx uses the correct configuration and redirects depending on the deployment environment.

Context & Requirements

  • The Docker build process should be aware of the environment it's building for (e.g., production, dev, staging, test).
  • The environment should be determined by the branch name in GitHub Actions (e.g., “production” for the production branch).

Requested Changes

  1. After the line:
    COPY ./config/all/nginx/templates /etc/nginx/templates
    
    …add logic to copy all individual files (not the directory) from ./config/{ENV}/nginx/templates/ (where {ENV} is the build environment) to /etc/nginx/templates/.
  2. If the directory ./config/{ENV}/nginx/templates/ does not exist, or there are no files in it, the build should fail gracefully with a clear message.
  3. The environment variable must be passed to the Docker build via the GitHub Actions workflow, based on the branch name.
  4. On the dev branch, ./config/dev/nginx/templates/ should be used (as an example, there is just one file to copy).

Goal
This enables Nginx to know what environment it is running in and to use appropriate redirects and configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions