47 lines
1.3 KiB
Docker
47 lines
1.3 KiB
Docker
|
|
# Base image
|
|
FROM php:8.1-apache
|
|
|
|
# Install system packages
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# Services
|
|
redis-server nginx \
|
|
# Process supervisor
|
|
supervisor \
|
|
# Clean up
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Node.js LTS 18.x
|
|
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
|
|
&& apt-get update && apt-get install -y nodejs \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# copy the config file
|
|
COPY cosmostat_settings.yaml /app/cosmostat_settings.yaml
|
|
|
|
# Node on 3000
|
|
WORKDIR /usr/src/app
|
|
COPY web/node_server/ .
|
|
RUN npm install --only=production
|
|
|
|
# Apache on 8080
|
|
RUN sed -i 's/^Listen .*/Listen 8080/' /etc/apache2/ports.conf && \
|
|
sed -i 's/<VirtualHost \*:80>/<VirtualHost \*:8080>/' /etc/apache2/sites-enabled/000-default.conf
|
|
COPY web/html/ /var/www/html/
|
|
|
|
# nginx on 80
|
|
RUN rm -rf /etc/nginx/sites-enabled/default
|
|
COPY web/proxy/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Add supervisord configuration
|
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
|
|
|
# Expose ports
|
|
EXPOSE 80
|
|
EXPOSE 6379
|
|
|
|
# healthcheck looks for apache
|
|
HEALTHCHECK CMD netstat -ltn | grep -c ":8080" > /dev/null; if [ 0 != $? ]; then exit 1; fi;
|
|
|
|
# Start supervisord
|
|
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |