Hi all-

This is like a mock up i am going to fool with that might yield apache royale 
soon on my docker. 

# Use Debian as base image
FROM debian:bookworm-slim

# Set environment variables
ENV DEBIAN_FRONTEND noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y --no-install-recommends \
    apache2 \
    mysql-server \
    php \
    php-mysql \
    libapache2-mod-php \
    wget \
    unzip \
    openjdk-11-jdk \
    net-tools \
    supervisor \
    nano \
    php-dev \
    autoconf \
    automake \
    libtool \
    vim \
    gcc \
    make \
    less \
    curl \
    && rm -rf /var/lib/apt/lists/*

# Define the environment variable for Apache Royale
ENV ROYALE_VERSION=1.0.0
ENV ROYALE_HOME=/opt/apache-royale

# Download and install Apache Royale
RUN mkdir -p ${ROYALE_HOME} && \
    wget 
https://downloads.apache.org/royale/royale-${ROYALE_VERSION}/apache-royale-${ROYALE_VERSION}-bin.zip
 -O /tmp/royale.zip && \
    unzip /tmp/royale.zip -d ${ROYALE_HOME} && \
    rm /tmp/royale.zip

# Set the environment variable for Apache Royale commands
ENV PATH="${ROYALE_HOME}/apache-royale-${ROYALE_VERSION}/bin:${PATH}"

# Copy a custom Apache configuration file if you have one
# COPY my_apache_config.conf /etc/apache2/sites-available/000-default.conf

# Create necessary directories
RUN mkdir -p /src /src/modules /usr/lib/php/20220829 
# Set the working directory
WORKDIR /src

# Copy PHP extension source code into the Docker image
COPY . .


# Run phpize and build the PHP extension
RUN phpize \
    && ./configure --prefix=/usr/lib/php/20220829 && make && make install
   
# Set up Supervisor (assuming you have a supervisord.conf)
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", 
"/etc/supervisor/conf.d/supervisord.conf"]
# Create non-root user and group for Supervisor
RUN groupadd -r supervisor && useradd -r -g supervisor supervisor

RUN mkdir -p /.libs \
    && chown -R supervisor:supervisor /.libs \
    && chmod -R 777 /.libs

WORKDIR /var/run

# Ensure supervisor.sock exists and set permissions
RUN test -f /var/run/supervisor.sock || (rm -f /var/run/supervisor.sock && 
touch /var/run/supervisor.sock && chown supervisor:supervisor 
/var/run/supervisor.sock && chmod 666 /var/run/supervisor.sock)
RUN unlink /var/run/supervisor.sock

# Set permissions for /var/run directory
RUN chmod 777 /var/run    
# Switch to non-root user

USER root
# Set log permissions only if supervisord.log exists
RUN chown -R supervisor:supervisor /var/log \
    && chmod 777 /var/log 
RUN test -f /var/log/supervisord.log && chmod 666 /var/log/supervisord.log || :


# Set working directory for XAMPP (assuming this is where your application runs)
WORKDIR /xampp

# Define volumes and expose ports
VOLUME /src /src/modules /usr/lib/php/20220829 /.libs
EXPOSE 3306
EXPOSE 80
CMD ["bash", "-c", "service mysql start && apachectl -D FOREGROUND"]
# Set the working directory
WORKDIR ${ROYALE_HOME}/apache-royale-${ROYALE_VERSION}

# Default command to execute Apache Royale commands (you can change this 
according to your needs)
CMD ["bash"]...

I hope if you are not already doing docker that might help or give you some 
ideas. I am running supervisor as root. You may wish to adjust to run it as 
user supervisor. Code is being worked on soon.

thanks,
jim

Sent with Proton Mail secure email.

Reply via email to