-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add ability to run local Apache server to test htaccess redirec…
…ts (#1421) * feat: add a dockerfile for testing htaccess rules locally * feat: add a docker-compose file for running a local webserver to test htaccess rules * docs: explain how to use docker compose to test htaccess rules locally * docs: add more details based on feedback
- Loading branch information
1 parent
355a732
commit decb6ee
Showing
3 changed files
with
49 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# For local development purposes only | ||
|
||
FROM httpd:alpine | ||
|
||
RUN rm -r /usr/local/apache2/htdocs/* | ||
COPY /build /usr/local/apache2/htdocs/ | ||
|
||
# Remove SSL requirement | ||
RUN sed -i \ | ||
'/SERVER_PORT/d;/SERVER_NAME/d' \ | ||
/usr/local/apache2/htdocs/.htaccess | ||
|
||
# Enable the rewrite module | ||
RUN sed -i \ | ||
-e 's/^#\(LoadModule .*mod_rewrite.so\)/\1/' \ | ||
/usr/local/apache2/conf/httpd.conf | ||
|
||
# Enable rewrites | ||
RUN sed -i '/<Directory "\/usr\/local\/apache2\/htdocs">/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /usr/local/apache2/conf/httpd.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: "3.9" | ||
services: | ||
webserver: | ||
build: . | ||
ports: | ||
- "3001:80" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters