auto-ssl-lua-resty-auto-ssl
SUCCESS
13m 48s
History Source
SummaryIterations1Transcript21Dockerfile
Dockerfile51 lines · 1281 chars
FROM openresty/openresty:1.15.8.2-1-bionic

ENV DEBIAN_FRONTEND=noninteractive

# Install build and runtime dependencies
RUN apt-get update && \
  apt-get -y install \
    bash \
    coreutils \
    curl \
    diffutils \
    grep \
    openssl \
    sed \
    build-essential \
    git \
    lsof \
    procps

# Create application source directory
RUN mkdir /app
WORKDIR /app

# Install the project from source into OpenResty's Lua directory
ENV INST_LUADIR=/usr/local/openresty/lualib
ENV INST_BINDIR=/usr/local/openresty/bin

# Copy Makefile first to leverage build context caching
COPY Makefile /app/Makefile

# Copy all source files
COPY . /app

# Prepare build outputs required by 'make install'
RUN mkdir -p /app/build/bin && \
  printf '#!/bin/sh\necho dehydrated placeholder' > /app/build/bin/dehydrated && \
  printf '#!/bin/sh\necho sockproc placeholder' > /app/build/bin/sockproc && \
  chmod +x /app/build/bin/dehydrated /app/build/bin/sockproc

# Build and install lua-resty-auto-ssl into OpenResty Lua path
RUN make install

# Ensure proper permissions on installed files
RUN chmod -R a+r /usr/local/openresty/lualib

# Expose standard OpenResty ports
EXPOSE 80 443

# Run OpenResty in the foreground
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]