Compare commits
5
Commits
2b41a981d5
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2f2bc7181c | ||
|
|
d7bdca2190 | ||
|
|
f9d0af137b | ||
|
|
3d937daae1 | ||
|
|
9bae9d8b70 |
No files matched your search
@@ -0,0 +1,7 @@
|
||||
nginx.conf.compiled
|
||||
logs/
|
||||
client_body_temp/
|
||||
fastcgi_temp/
|
||||
proxy_temp/
|
||||
scgi_temp/
|
||||
uwsgi_temp/
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
# TODO This should be in its own place to reference for all projects,
|
||||
# built pre-project
|
||||
|
||||
FROM openresty/openresty:1.31.1.1-bookworm
|
||||
|
||||
LABEL maintainer = "Tangent/Rose <tangentfoxy@gmail.com>"
|
||||
ENV RUN_ENV=development
|
||||
|
||||
RUN mkdir /app
|
||||
VOLUME /app
|
||||
|
||||
EXPOSE 8080
|
||||
WORKDIR /app
|
||||
ENTRYPOINT ["sh", "-c", "sleep 5 && lapis migrate $RUN_ENV && lapis serve $RUN_ENV"]
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get upgrade -y
|
||||
RUN apt-get install libssl-dev git -y # OpenSSL header dependency
|
||||
|
||||
RUN luarocks install lapis
|
||||
RUN luarocks install luacrypto # legacy requirement (lapis)
|
||||
RUN luarocks install bcrypt
|
||||
RUN luarocks install lapis-console
|
||||
RUN luarocks install lua-cjson
|
||||
# RUN luarocks install markdown # legacy requirement; probably discardable
|
||||
|
||||
# clean up
|
||||
RUN apt-get autoremove -y
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
# legacy
|
||||
# actually build stuff!
|
||||
# RUN luarocks install moonscript
|
||||
# COPY . .
|
||||
# RUN moonc .
|
||||
@@ -0,0 +1,8 @@
|
||||
local lapis = require("lapis")
|
||||
local app = lapis.Application()
|
||||
|
||||
app:get("/", function()
|
||||
return "Welcome to Lapis " .. require("lapis.version")
|
||||
end)
|
||||
|
||||
return app
|
||||
@@ -0,0 +1,8 @@
|
||||
local config = require("lapis.config")
|
||||
|
||||
config("development", {
|
||||
server = "nginx",
|
||||
code_cache = "off",
|
||||
num_workers = "1",
|
||||
port = "8080",
|
||||
})
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
types {
|
||||
text/html html htm shtml;
|
||||
text/css css;
|
||||
text/xml xml;
|
||||
image/gif gif;
|
||||
image/jpeg jpeg jpg;
|
||||
application/x-lua lua;
|
||||
application/x-moonscript moon;
|
||||
application/x-javascript js;
|
||||
application/atom+xml atom;
|
||||
application/rss+xml rss;
|
||||
|
||||
text/mathml mml;
|
||||
text/plain txt;
|
||||
text/vnd.sun.j2me.app-descriptor jad;
|
||||
text/vnd.wap.wml wml;
|
||||
text/x-component htc;
|
||||
|
||||
image/png png;
|
||||
image/tiff tif tiff;
|
||||
image/vnd.wap.wbmp wbmp;
|
||||
image/x-icon ico;
|
||||
image/x-jng jng;
|
||||
image/x-ms-bmp bmp;
|
||||
image/svg+xml svg svgz;
|
||||
image/webp webp;
|
||||
|
||||
application/java-archive jar war ear;
|
||||
application/mac-binhex40 hqx;
|
||||
application/msword doc;
|
||||
application/pdf pdf;
|
||||
application/postscript ps eps ai;
|
||||
application/rtf rtf;
|
||||
application/vnd.ms-excel xls;
|
||||
application/vnd.ms-powerpoint ppt;
|
||||
application/vnd.wap.wmlc wmlc;
|
||||
application/vnd.google-earth.kml+xml kml;
|
||||
application/vnd.google-earth.kmz kmz;
|
||||
application/x-7z-compressed 7z;
|
||||
application/x-cocoa cco;
|
||||
application/x-java-archive-diff jardiff;
|
||||
application/x-java-jnlp-file jnlp;
|
||||
application/x-makeself run;
|
||||
application/x-perl pl pm;
|
||||
application/x-pilot prc pdb;
|
||||
application/x-rar-compressed rar;
|
||||
application/x-redhat-package-manager rpm;
|
||||
application/x-sea sea;
|
||||
application/x-shockwave-flash swf;
|
||||
application/x-stuffit sit;
|
||||
application/x-tcl tcl tk;
|
||||
application/x-x509-ca-cert der pem crt;
|
||||
application/x-xpinstall xpi;
|
||||
application/xhtml+xml xhtml;
|
||||
application/zip zip;
|
||||
|
||||
application/octet-stream bin exe dll;
|
||||
application/octet-stream deb;
|
||||
application/octet-stream dmg;
|
||||
application/octet-stream eot;
|
||||
application/octet-stream iso img;
|
||||
application/octet-stream msi msp msm;
|
||||
|
||||
audio/midi mid midi kar;
|
||||
audio/mpeg mp3;
|
||||
audio/ogg ogg;
|
||||
audio/x-m4a m4a;
|
||||
audio/x-realaudio ra;
|
||||
|
||||
video/3gpp 3gpp 3gp;
|
||||
video/mp4 mp4;
|
||||
video/mpeg mpeg mpg;
|
||||
video/quicktime mov;
|
||||
video/webm webm;
|
||||
video/x-flv flv;
|
||||
video/x-m4v m4v;
|
||||
video/x-mng mng;
|
||||
video/x-ms-asf asx asf;
|
||||
video/x-ms-wmv wmv;
|
||||
video/x-msvideo avi;
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
local autoload = require("lapis.util").autoload
|
||||
return autoload("models")
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
worker_processes ${{num_workers}};
|
||||
error_log stderr notice;
|
||||
daemon off;
|
||||
pid logs/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include mime.types;
|
||||
|
||||
init_by_lua_block {
|
||||
require "lpeg"
|
||||
}
|
||||
|
||||
server {
|
||||
listen ${{port}};
|
||||
lua_code_cache ${{code_cache}};
|
||||
|
||||
location / {
|
||||
default_type text/html;
|
||||
content_by_lua_block {
|
||||
require("lapis").serve("app")
|
||||
-- require("path_fix")
|
||||
}
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
alias static/;
|
||||
}
|
||||
|
||||
location /favicon.ico {
|
||||
alias static/favicon.ico;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
-- WARNING this works in LuaJIT but fails in OpenResty; it somehow ignores the path
|
||||
|
||||
-- there is no way to find the correct load path / current user from OpenResty
|
||||
local CODE_PATH = "/Users/tangent/.luarocks/share/lua/5.1/"
|
||||
|
||||
local lapis
|
||||
local success, error_message = pcall(function() return require("lapis") end)
|
||||
|
||||
if success then
|
||||
lapis = error_message
|
||||
else
|
||||
package.path = package.path .. ";" .. CODE_PATH .. "?.lua;" .. CODE_PATH .. "?/init.lua"
|
||||
lapis = require("lapis")
|
||||
end
|
||||
|
||||
lapis.serve("app")
|
||||
Reference in new issue
Block a user