Coder Social home page Coder Social logo

aquaron / anle Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 36 KB

Alpine Nginx Let's Encrypt Reverse Proxy

Home Page: https://store.docker.com/community/images/aquaron/anle

License: MIT License

Shell 91.54% HTML 3.20% PHP 1.55% Dockerfile 3.71%
alpine certificate docker nginx certbot letsencrypt

anle's Introduction

ANLE Reverse Proxy Image

Nginx build on Alpine with Certbot to use as a reverse proxy.

runme.sh

Launches nginx by default. If configuration is not found, initializes with default configuration. runme.sh accepts these commands:

Command Description
init initialize directories if they're empty
renew similar to init but renews certs instead
daemon run in non-detached mode
certbot create/renew certificate
start start nginx server
stop stop nginx server
quit gracefully stop nginx server
reload reloads nginx configurations
reopen reopens nginx log files
kill killall nginx
test check nginx's configuration

init

Initializes the server with all the necessary configurations and certificate. Example:

runme.sh init virtual-host.example.com [email protected]

virtual-host.example.com is the target to get Let's Encrypt certificate for. [email protected] is your email address required by LE.

renew

Renewing certificates by initializing with renewal instead of creating new certs:

runme.sh renew

daemon

Put nginx in the foreground so that it wouldn't stop when the container detatches.

certbot

Get or renew a certificate for the specified host:

runme.sh certbot virtual-host.example.com [email protected]

You can also use the script get-cert.sh located in the etc directory to generate new LE certificates.

start, stop, quit, kill

These are convenience commands when you're inside the running container use for starting and stopping.

reload, reopen, test

When you change configurations, reload and test it.


<local-dir>/data

anle requires this stucture if you're not using the init command to create

/<local-dir>/data (anywhere you want)
|
+-- /etc                (configurations)
|   |
|   +-- nginx.conf      (default)
|   +-- mime.types      (default)
|   +-- /conf.d
|       |
|       +-- proxy.conf  (default)
|       +-- mime.types  (auto generated)
|       +-- 80.conf     (auto generated)
|       +-- 443.conf    (auto generated, edit REQUIRED)
|       +-- get-cert.sh (re/new certificate for a host)
|    
+-- /html               (root)
|   |
|   +-- index.html      (default)
|   +-- 50x.html        (soft-link to index.html)
|
+-- /letsencrypt        (certificates)
|   |
|   +-- dhparam.pem     (default)
|   +-- /accounts       (le auto generated)
|   +-- /keys           (le auto generated)
|   +-- /csr            (le auto generated)
|   +-- /renewal        (le auto generated)
|   +-- /live           (le auto generated - REQUIRED)
|   +-- /archive        (le auto generated)
|
+-- /log                (logs and pid files)

All the default files are required, donnot delete. auto generated files are not required, they will be generated.


Usage Instruction

Initialize & Let's Encrypt Certificate

Initialize the configurations and get the certificate:

docker run --rm -t -v <local-dir>:/data \
    -p 80:80 -p 443:443 \
    aquaron/anle \
        init <hostname> <email>

Edit 443.conf

Edit <local-dir>/etc/conf.d/443.conf and change configuration for upstream hosts to match your virtual hosts settings.

install-systemd.sh

Installs docker-anle.service to your systemd configuration. Find this script in your <local-dir>/etc directory.

Run Daemon

Using systemctl

If you've used the install-systemd.sh script, you can issue these commands to start/stop your service:

systemctl start docker-anle.service
systemctl stop docker-anle.service

Manual

You can manually start the container by running the commands found in docker-anle.service:

docker run -v <local-dir>:/data \
    -p 80:80 -p 443:443 \
    --name anle -h anle \
    -d aquaron/anle

Debugging

Enter the container and poke around:

docker run --rm -it -v <local-dir>:/data \
    -p 80:80 -p 443:443 \
    --entrypoint=/bin/sh \
    aquaron/anle

Once inside use the runme.sh to control the server.

anle's People

Contributors

pham avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.