Browse Source

redis fix, docker php build

Tobias von Dewitz 7 years ago
parent
commit
41cbb95905
2 changed files with 13 additions and 7 deletions
  1. 12 6
      Dockerfile
  2. 1 1
      lua/scw.lua

+ 12 - 6
Dockerfile

@@ -1,7 +1,13 @@
-FROM httpd:2.4-alpine
+FROM php:7.2-apache-stretch
 
-RUN echo "Include conf/extra/httpd-lua.conf" >> /usr/local/apache2/conf/httpd.conf
-RUN apk add --no-cache lua
-RUN apk add --no-cache lua-redis lua-socket lua-cjson
-RUN apk add --no-cache lua-rex-pcre
-RUN apk add --no-cache lua-ossl
+RUN apt-get -y update
+RUN apt-get -y install lua lua-redis lua-socket lua-cjson lua-rex-pcre lua-luaossl
+
+
+#FROM httpd:2.4-alpine
+
+#RUN echo "Include conf/extra/httpd-lua.conf" >> /usr/local/apache2/conf/httpd.conf
+#RUN apk add --no-cache lua
+#RUN apk add --no-cache lua-redis lua-socket lua-cjson
+#RUN apk add --no-cache lua-rex-pcre
+#RUN apk add --no-cache lua-ossl

+ 1 - 1
lua/scw.lua

@@ -94,7 +94,7 @@ function scw(r)
     if redis_port == nil or redis_port == "" then
       r:err("SCW_REDIS_PORT is not set!")
     end
-    if pcall(function() redis_conn = redis.connect(redis_host, 6379) end) then
+    if pcall(function() redis_conn = redis.connect(redis_host, redis_port) end) then
       has_redis = true
     end
   end