Skip to content
This repository was archived by the owner on Jan 17, 2024. It is now read-only.

Anthonyntilelli/example-docker-and-github-actions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example Docker and Github Actions

Demo creating an Apache docker container from a Base OS image, uploaded to github via github actions

Table of Contents

  1. Demo
  2. Usage: Build
  3. Usage: Deploy
  4. Requirements
  5. Registry

Demo:

  • Create Apache Image from base OS Image
  • Configure https using self signed certificate
    • Do not build the certificates into the Image
  • Configure http redirect to https
  • Configure the http/https homepage to display "Docker Apache Challenge"
  • The Web service should be listening over standard Web ports (80 and 443).
  • Make use of CI tool to:
    • Build docker Images
    • Verify Docker builds
    • Push to GitLab Registry

Usage: Build

  • CONTAINER_NAME="name"
  • docker build . -t $CONTAINER_NAME

Usage: Deploy

  • APA_REDIRECT="127.0.0.1"
    • set redirect to where you want apache to redirect port 80 connections.
    • Do not include "https" or "http"
  • APA_CERT="$(pwd)/test"
    • set to location of the certificate and key
    • Use absolute value location
  • docker run -p 80:80 -p 443:443 -e "APACHE_REDIRECT_IP=$APA_REDIRECT" --mount type=bind,source="$APA_CERT",target=/cert,readonly $CONTAINER_NAME

Requirements:

  • Docker
  • Certificate named: domain.crt
  • Certificate key (plain text) named: domain.key
  • ENV variable: "APACHE_REDIRECT_IP" determines where apache will redirect on port 80

Registry:

  • CI Tool builds/pushes GitHub Registry
  • Project permission is required to pull from registry.

Author:

  • Anthony Tilelli

About

Example of Docker and GitHub actions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages