I have a project with a Dockerfile that roughly has the following:
FROM php:7.2-apache
# supervisor installation &&
# create directory for child images to store configuration in
RUN apt-get -y install supervisor && \
mkdir -p /var/log/supervisor && \
mkdir -p /etc/supervisor/conf.d
# supervisor configurations
ADD /.docker/conf/supervisor/conf.d/apache.conf /etc/supervisor/conf.d/apache.conf
ADD /.docker/conf/supervisor/conf.d/Emails.conf /etc/supervisor/conf.d/Emails.conf
# Docker will start only supervisord
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisor.conf"]
apache.conf is supervisor keeping apache alive and Emails.conf is Laravel’
s queue:work command kept alive.
However my app in App Platform fails with:
2021-12-03T10:31:17.440161328Z Unlinking stale socket /var/run/supervisor.sock 2021-12-03T10:31:17.741289162Z Error: Another program is already listening on a port that one of our HTTP servers is configured to use. Shut this program down first before starting supervisord. 2021-12-03T10:31:17.741327485Z For help, use /usr/bin/supervisord -h
The error occurs only in App Platform, Docker builds the container OK.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
It seems like that there is a conflict over port usage. The message “Another program is already listening on a port that one of our HTTP servers is configured to use” indicates that supervisord is trying to bind to a port already in use, likely by the built-in Apache server in the php:7.2-apache image.
You could check that the supervisor configuration files (apache.conf and Emails.conf) do not specify services that bind to ports already in use. Specifically, check if the Apache configuration under supervisor is not trying to start another instance of Apache that’s already running by default in the php:7.2-apache image.
On another note, a quick update here, the App Platform now supports this via Aptfile which would allow you to use the native PHP buildpack and install custom dependenices:
https://docs.digitalocean.com/products/app-platform/reference/buildpacks/aptfile/
App Platform looks for a file named Aptfile (no file extension) to detect an application requiring system packages. If this file is detected, the heroku-buildpack-apt buildpack is used to install any packages listed in the Aptfile during the build process.
The following example Aptfile declares three system packages to install:
libpq-dev
imagemagick
curl
This example installs:
libpq-dev: A library for PostgreSQL applications.imagemagick: A command-line tool for image processing.curl: A command line tool for making HTTP requests.Hope that this helps!
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.