Skip to content

This is an nginx-lua based simple application based on docker. There is an nginx with lua on the front end, and two postgresql databases setup as master-slave on the backend.

Notifications You must be signed in to change notification settings

jamesattard/nginx_lua_docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

nginx_lua_docker

Introduction

This is an nginx-lua based simple application based on docker. There is an nginx with lua on the front end, and two postgresql databases setup as master-slave on the backend. This is a private build, not found in DockerHub and author assumes no responsibility. It was part of a technical interview that the author decided to spice it up a bit using Docker.

Tech

I used the following Docker images:

  • Official Centos image (centos7) to build Nginx and compile Lua
  • PostgreSQL image (sameersbn/postgresql:9.4-11) to build a master-slave postgresql cluster

I have also used OpenResty (openresty.org) as a web platform that integrates nginx wih lua core and other lua libs.

Getting started

Installation

git clone https://github.com/jamesattard/nginx_lua_docker.git

Quickstart

Start the containers using:

docker-compose up -d db_master
docker-compose up -d db_slave
docker-compose up -d app_lua

Send a POST request to the app server:

docker exec -it nginxluadocker_app_lua_1 curl -X POST http://localhost:8080/post?title=Article1\&body=body1

Get the last 100 messages from the database:

docker exec -it nginxluadocker_app_lua_1 curl http://localhost:8080/get

About

This is an nginx-lua based simple application based on docker. There is an nginx with lua on the front end, and two postgresql databases setup as master-slave on the backend.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published