Skip to content

Commit

Permalink
Optimized docker-compose and Dockerfile to port 8080
Browse files Browse the repository at this point in the history
  • Loading branch information
TomHAnderson committed Nov 5, 2023
1 parent 8afb32c commit 53584e3
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .docker/config/000-default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<VirtualHost *:80>
ServerName etreedb.org
<VirtualHost *:8080>
ServerName graphql.lcdb.org
DocumentRoot "/var/www/public"

<Directory "/var/www/public">
Expand Down
4 changes: 2 additions & 2 deletions .docker/config/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ServerRoot "/usr/local/apache2"
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
Listen 80
Listen 8080

#
# Dynamic Shared Object (DSO) Support
Expand Down Expand Up @@ -235,7 +235,7 @@ ServerAdmin [email protected]
#
# If your host doesn't have a registered DNS name, enter its IP address here.
#
ServerName docker.db.etreedb.org:80
ServerName graphql.lcdb.org

#
# Deny access to the entirety of your server's filesystem. You must
Expand Down
5 changes: 5 additions & 0 deletions .docker/config/ports.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf

Listen 8080
15 changes: 9 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.1-apache
FROM php:8.2-apache

# Install system dependencies
RUN apt-get update && apt-get install --yes \
Expand All @@ -17,12 +17,9 @@ RUN apt-get update && apt-get install --yes \
zip \
unzip \
vim \
git \
wget \
procps \
sudo \
default-mysql-client \
snmp \
libsnmp-dev \
libcurl4-openssl-dev \
libzip-dev \
Expand All @@ -46,9 +43,15 @@ RUN docker-php-ext-install \
RUN pecl install redis
RUN docker-php-ext-enable redis


# Apache
RUN a2enmod rewrite
COPY .docker/config/ports.conf /etc/apache2/ports.conf
COPY .docker/config/000-default.conf /etc/apache2/sites-available/000-default.conf
RUN rm /etc/apache2/sites-enabled/000-default.conf
RUN ln -s /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf

# PHP
COPY .docker/config/php.ini /usr/local/etc/php/php.ini

# Get latest Composer
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
Expand All @@ -62,4 +65,4 @@ ADD . /var/www
RUN rm -rf vendor
RUN composer install --no-dev

EXPOSE 80
EXPOSE 8080
14 changes: 5 additions & 9 deletions docker-compose.yml.dist
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3"
version: "3.7"
services:
mysql:
image: mariadb
Expand All @@ -7,27 +7,23 @@ services:
ports:
- "3306:3306"
volumes:
- db-graphql-mysql:/var/lib/mysql
- mysql:/var/lib/mysql
- ./.docker/config/my.cnf:/etc/mysql/conf.d/custom.cnf
- ./db/now_usec/now_usec.so:/usr/lib/mysql/plugin/now_usec.so

redis:
image: redis:latest

web:
www:
build:
context: .
dockerfile: Dockerfile
depends_on:
- mysql
volumes:
- .:/var/www/
- ./.docker/config/php.ini:/usr/local/etc/php/php.ini
- ./.docker/config/000-default.conf:/etc/apache2/sites-available/000-default.conf
container_name: lcdb-graphql-www
ports:
- "80:80"
- "80:8080"

volumes:
db-graphql-mysql:
mysql:
driver: local

0 comments on commit 53584e3

Please sign in to comment.