I’m trying to containerize a Symfony Application, Before that, I used it via ssh, but in order to optimize, I’m trying to upload a Docker container but I don’t know what settings are needed for Apache
Dockerfile:
FROM php:7.0-apache
# Update stretch repositories
RUN sed -i -e 's/deb.debian.org/archive.debian.org/g'
-e 's|security.debian.org|archive.debian.org/|g'
-e '/stretch-updates/d' /etc/apt/sources.list
# Install and configure some project requirements
RUN apt-get update
&& apt-get install -y
apt-utils
libpng-dev
libjpeg-dev
libpq-dev
git
unzip
zlib1g-dev
libicu-dev
g++
# Install PHP extensions
RUN docker-php-ext-configure intl
&& docker-php-ext-install intl
&& docker-php-ext-install pdo_mysql
&& docker-php-ext-install mysqli
&& docker-php-ext-install gd
&& docker-php-ext-install zip
# Install XPDF and QPDF dependencies
RUN apt-get install -y cmake libqpdf-dev libqt4-dev qt4-qmake
RUN apt-get install -y python3 && cp /usr/bin/python3 /usr/bin/python
# Copy binaries to /tmp
COPY ./.docker/binaries/*.tar.gz /tmp/
# Set working directory to /tmp
WORKDIR /tmp
# Install XPDF dependency - Freetype
RUN tar -xf freetype-2.13.1.tar.gz && cd freetype-2.13.1 && ./configure && make && make install
# Install XPDF
RUN tar -xf xpdf-4.00.tar.gz && cd xpdf-4.00 && cmake -DCMAKE_BUILD_TYPE=Releas -DCMAKE_INSTALL_PREFIX=/opt/xpdf && make && make install
RUN tar -xf xpdf-tools-linux-4.04.tar.gz && mv xpdf-tools-linux-4.04 /usr/local/bin/xpdf-tools-linux-4.00
# Install QPDF
RUN tar -xf qpdf-8.0.2.tar.gz && cd qpdf-8.0.2 && ./configure && make && make install
RUN LD_LIBRARY_PATH=/usr/local/lib && export LD_LIBRARY_PATH
# Set working directory back to /
WORKDIR /
# Cleanup /tmp
RUN rm -rdf /tmp/*
# Copy the custom configuration files
COPY ./.docker/apache2/sites-available/vhost.conf /etc/apache2/sites-available/000-default.conf
COPY ./.docker/php/php.ini /usr/local/etc/php/php.ini
# Copy application files
COPY . /var/www/html
# Set working directory
WORKDIR /var/www/html
# Setup files permissions
RUN mkdir -p /var/www/html/web/ && chmod -R 755 /var/www/html/web/
RUN chmod -R 777 -R app/cache/
# Enable apache2 rewrite module
RUN a2enmod rewrite
# Set apache user
RUN chown -R www-data:www-data /var/www/html/
# Expose port 80
EXPOSE 80
# Set the default command to run when starting the container
CMD ["apache2-foreground"]
Docker compose:
version: '3.7'
services:
alow:
environment:
- COMPOSER_MEMORY_LIMIT=-1
- PHP_EXTENSION_XDEBUG=1
restart: unless-stopped
build:
context: .
dockerfile: .docker/Dockerfile
volumes:
- .:/var/www/html
- ./.docker/apache2/logs:/var/log/apache2
- ./config/parameter.yml:/app/config/parameter.yml
ports:
- '8001:80'
networks:
- app-network
networks:
app-network:
external: true
the container is running, but it says not found on the page
Do I need to configure something to have access to my routes?
dasd