Skip to content

Commit

Permalink
Miscellaneous changes (#83)
Browse files Browse the repository at this point in the history
* Remove customized file security.conf

Header directives can be set by librebooking itself.

* Handle remote ip when behind a reverse proxy

* Review instructions for 2nd option of the building process

---------

Co-authored-by: Robin Alexander <[email protected]>
  • Loading branch information
colisee and Robin Alexander authored Dec 18, 2023
1 parent b748613 commit ab1061d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 61 deletions.
4 changes: 2 additions & 2 deletions BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Run the following commands on your host:
# Log to the docker hub
docker login --username <your_docker_hub_profile>
# Setup the QEMU emulation for foreign architectures
docker run --privileged tonistiigi/binfmt -install all
# If needed, create a docker-container based build instance
docker buildx create --driver docker-container --use
# Build the docker image
docker buildx build \
Expand Down
13 changes: 10 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ FROM php:${PHP_VERSION}-apache

COPY entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
COPY security.conf /etc/apache2/conf-available/security.conf

# Install composer
COPY --from=composer/composer:latest-bin /composer /usr/bin/composer
Expand All @@ -22,17 +21,25 @@ RUN set -ex; \
apt-get clean; \
rm -rf /var/lib/apt/lists/*

# Customize php environment
# Customize apache and php settings
RUN set -ex; \
cp "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"; \
{ \
echo 'RemoteIPHeader X-Real-IP'; \
echo 'RemoteIPInternalProxy 10.0.0.0/8'; \
echo 'RemoteIPInternalProxy 172.16.0.0/12'; \
echo 'RemoteIPInternalProxy 192.168.0.0/16'; \
} > /etc/apache2/conf-available/remoteip.conf; \
a2enconf remoteip; \
a2enmod rewrite; \
a2enmod headers; \
a2enmod remoteip; \
docker-php-ext-configure gd --with-jpeg; \
docker-php-ext-install mysqli gd ldap; \
pecl install timezonedb; \
docker-php-ext-enable timezonedb;

# Get application and customize
# Get and customize librebooking
USER www-data
RUN set -ex; \
curl \
Expand Down
56 changes: 0 additions & 56 deletions security.conf

This file was deleted.

0 comments on commit ab1061d

Please sign in to comment.