# HOW TO: # # Generate a random secret key & build the Docker image # ```sh # SECRET_KEY=$(openssl rand -hex 32) docker build --build-arg PROD_SECRET_KEY="$SECRET_KEY" -t porom:latest . # ``` # # Then run the container # ```sh # docker run -d -p 8080:8080 --name porom porom:latest # ``` # FROM openresty/openresty:alpine-fat COPY ./nginx.conf /usr/local/openresty/nginx/conf/nginx.conf COPY . /usr/local/openresty/nginx/html WORKDIR /usr/local/openresty/nginx/html RUN apk add --no-cache \ make \ git \ make \ gcc \ g++ \ musl-dev \ libffi-dev \ openssl-dev \ sqlite-dev \ imagemagick-dev \ lua5.1 \ lua5.1-dev RUN eval "$(luarocks --lua-version 5.1 path)" RUN luarocks --lua-version 5.1 build --only-deps ARG PROD_SECRET_KEY RUN echo "return { key = \"${PROD_SECRET_KEY}\",}" > /usr/local/openresty/nginx/html/secrets.lua EXPOSE 8080 RUN chmod +x /usr/local/openresty/nginx/html/start.sh ENTRYPOINT ["/usr/local/openresty/nginx/html/start.sh", "production"]