lapis
lapis copied to clipboard
`lapis build` not compiling config correctly?
So I've been having this problem for a while now where I run lapis build development
and start changing things, but the changes don't appear (as if code-cache wasn't enabled). I think I finally found the cause:
After manually restarting the service, this is what the (correct) nginx configuration looks like:
...
http {
include mime.types;
charset utf-8;
server {
listen unix:/path/to/socket;
lua_code_cache off;
location / {
default_type text/html;
content_by_lua '
...
And, for some reason, after I run lapis build [development]
:
...
http {
include mime.types;
charset utf-8;
server {
listen ${{LISTEN}};
lua_code_cache off;
location / {
default_type text/html;
content_by_lua '
...
As you can see, the ${{listen}}
directive is not replaced (neither does it work when I use the default ${{PORT}}
)
Also note that lua_code_cache
is also set in the configuration, but for some reason works.
I had this issue yesterday. Basically, I was trying to compile a profile that didn't exist. Consider the following profile:
config("development", {
port = 80
})
The profile is named development
so when I want to run that profile, I need to execute lapis server development
. If I use any other profile name such as [development]
or dev
, it's not going to compile properly. In my case, I was running older code against a newer docker image so I just needed to update my config a bit.