-
I'm new to Docker, so please forgive me if the answer is obvious. I'm running into an issue when running The most obvious answer is to check what is running on port 9000. As I'm running this locally on Mac for now, I ran I've included logs and my configuration files below for reference. I appreciate any guidance you may have Logsepp-core-app | 👉 [NOTICE]: Improve PHP performance by setting PHP_OPCACHE_ENABLE=1 (recommended for production).
epp-core-app | ℹ️ NOTICE (init-webserver-config): /etc/nginx/nginx.conf already exists, so we'll use the existing file.
epp-core-app | ℹ️ NOTICE (init-webserver-config): /etc/nginx/site-opts.d/http.conf already exists, so we'll use the existing file.
epp-core-app | ℹ️ NOTICE (init-webserver-config): /etc/nginx/site-opts.d/https.conf already exists, so we'll use the existing file.
epp-core-app | ℹ️ NOTICE (init-webserver-config): /etc/nginx/conf.d/default.conf already exists, so we'll use the provided configuration.
epp-core-app | [06-Oct-2024 13:15:33] NOTICE: fpm is running, pid 88
epp-core-app | [06-Oct-2024 13:15:33] NOTICE: ready to handle connections
epp-core-app | ✅ NGINX + PHP-FPM is running correctly.
epp-core-app | [06-Oct-2024 13:15:34] NOTICE: Failed implicitly binding to ::, retrying with 0.0.0.0
epp-core-app | [06-Oct-2024 13:15:34] ERROR: unable to bind listening socket for address '9000': Address in use (98)
epp-core-app | [06-Oct-2024 13:15:34] ERROR: FPM initialization failed
epp-core-app | [06-Oct-2024 13:15:34] NOTICE: Terminating ...
epp-core-app | [06-Oct-2024 13:15:34] NOTICE: exiting, bye-bye!
epp-core-app exited with code 78 DockerfileFROM serversideup/php:8.3-fpm-nginx-alpine
LABEL authors="marcbeinder"
# Ensure we are running as root for package installations
USER root
# Use the build arguments to change the UID
# and GID of www-data while also changing
# the file permissions for NGINX
RUN docker-php-serversideup-set-id www-data 82:82 && \
\
# Update the file permissions for our NGINX service to match the new UID/GID
docker-php-serversideup-set-file-permissions --owner 82:82 --service nginx
# Install system dependencies and clear apk cache afterward
RUN apk update && apk add \
git \
curl \
libpng-dev \
oniguruma-dev \
libxml2-dev \
zip \
unzip && \
rm -rf /var/cache/apk/*
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create the home directory for the user and set ownership
RUN mkdir -p /home/www-data/.composer && \
chown -R www-data:www-data /home/www-data
# Set the working directory
WORKDIR /var/www
# Switch to non-root user after package installations
USER www-data
# Define the default command for PHP-FPM
CMD ["php-fpm"] docker-compose.ymlservices:
nginx:
image: nginx:1.17-alpine
container_name: epp-core-nginx
restart: unless-stopped
ports:
- "80:8080"
volumes:
- ./:/var/www
- ./.config/nginx:/etc/nginx/conf.d
networks:
- epp-core-net
app:
build:
args:
userId: 1000
groupId: 1000
context: ./
dockerfile: Dockerfile
image: epp-core
container_name: epp-core-app
restart: unless-stopped
stop_signal: SIGTERM
working_dir: /var/www/
volumes:
- ./:/var/www
networks:
- epp-core-net
scheduler:
build:
context: ./
dockerfile: Dockerfile
args:
userId: 1000
groupId: 1000
image: epp-core
container_name: epp-core-scheduler
restart: unless-stopped
stop_signal: SIGTERM
working_dir: /var/www/
command: [ "php", "/var/www/artisan", "schedule:work" ]
volumes:
- ./:/var/www
networks:
- epp-core-net
queue:
build:
context: ./
dockerfile: Dockerfile
args:
userId: 1000
groupId: 1000
image: epp-core
container_name: epp-core-queue
restart: unless-stopped
stop_signal: SIGTERM
working_dir: /var/www/
command: [ "php", "/var/www/artisan", "queue:work" ]
volumes:
- ./:/var/www
networks:
- epp-core-net
networks:
epp-core-net:
driver: bridge nginx.conf
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 10 replies
-
That's really strange you're seeing that error because you're not exposing 9000 on your host. Our of curiosity, have you seen our project Spin? It might help with a lot of what you're trying to achieve. Instead of running NGINX → FPM-NGINX, we have a nice template to give you Traefik → FPM-NGINX on Alpine if it meets your project requirements. No pressure to change to Spin, but just wanted to share it so it's on your radar: https://serversideup.net/open-source/spin If you want to test something out, you could install Spin then run In regards to the port 9000 being used, my gut points to this:
I wonder if this is an IPv6 thing? Are you running macOS Sequoia by any chance? |
Beta Was this translation helpful? Give feedback.
-
Apologies for the delayed reply, this weekend is moving weekend for me! I have seen spin only briefly as a result of my research but I have not had the chance to take a deep look yet. I can try to give spin a shot and try the I did make some progress by switching the image to Yes, I am currently running macOS Sequoia 15.01 on a 2019 MacBook Pro. It's probably going to be something super obvious resulting in a glorious facepalm. 🤓🤦🏻♂️ |
Beta Was this translation helpful? Give feedback.
I got it working!! Thanks @jaydrogers for your help! For reference and for future people who need help, I'll include the Dockerfile and docker-compose.yml file below:
Dockerfile