Skip to content

Commit

Permalink
changed default ports to allow non-root install/run of docker container
Browse files Browse the repository at this point in the history
  • Loading branch information
nikirago committed Jul 6, 2021
1 parent 592f902 commit 1e9a622
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ MAINTAINER YesInteractive- http://yes-interactive.com
RUN apk update \
&& apk --no-cache add \
openssl=="1.1.1k-r0" \
apache2=="2.4.46-r0" \
apache2=="2.4.48-r0" \
apache2-ssl \
apache2-http2 \
unzip \
Expand Down Expand Up @@ -39,6 +39,9 @@ RUN apk update \
&& mkdir /app && chown -R apache:apache /app \
&& sed -i -e 's/\/var\/www\/localhost\/htdocs/\/app/g' /etc/apache2/httpd.conf \
&& sed -i -e 's/\/var\/www\/localhost\/htdocs/\/app/g' /etc/apache2/conf.d/ssl.conf \
# Change default ports
&& sed -i -e 's/Listen 80/Listen 8100/g' /etc/apache2/httpd.conf \
&& sed -i -e 's/443/8143/g' /etc/apache2/conf.d/ssl.conf \
# Allow for custom apache configs
&& mkdir /etc/apache2/conf.d/custom \
&& echo '' >> /etc/apache2/httpd.conf \
Expand All @@ -61,7 +64,7 @@ RUN apk update \
WORKDIR /app

# Export http and https
EXPOSE 80 443
EXPOSE 8100 8143

# Run apache in foreground
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
CMD ["/usr/sbin/httpd", "-D", "FOREGROUND"]
12 changes: 6 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
![Dad Jokes As A Microservice](https://raw.githubusercontent.com/yesinteractive/dad-jokes_microservice/master/public/dadjokes-microservice.png)

[![Docker Pulls](https://img.shields.io/docker/pulls/yesinteractive/dadjokes?style=for-the-badge)](https://hub.docker.com/r/yesinteractive/dadjokes)
[![GitHub stars](https://img.shields.io/github/stars/yesinteractive/dad-jokes_microservice?style=for-the-badge)](https://github.com/yesinteractive/dad-jokes_microservice)
[![GitHub release](https://img.shields.io/github/release/yesinteractive/dad-jokes_microservice?style=for-the-badge)](https://github.com/yesinteractive/dad-jokes_microservice)
[![GitHub stars](https://img.shields.io/github/stars/yesinteractive/dadjokes?style=for-the-badge)](https://github.com/yesinteractive/dad-jokes_microservice)
[![GitHub release](https://img.shields.io/github/release/yesinteractive/dadjokes?style=for-the-badge)](https://github.com/yesinteractive/dad-jokes_microservice)
![MIT](https://img.shields.io/badge/license-MIT-green?style=for-the-badge)



Just a sample microservice or echo service used for testing API Gateways such as Kong, Kubernetes K8s, Openshift, Docker,
Service meshes such as Kuma or Istio, etc. as an alternative to httpbin. Feel free
to [add your own jokes](https://github.com/yesinteractive/dad-jokes_microservice/blob/master/controllers/jokes.txt)
to [add your own jokes](https://github.com/yesinteractive/dadjokes/blob/master/controllers/jokes.txt)
to this repo as well. In addition to a dad joke, the service will automatically echo back information about the
incoming request. This is helpful for testing and troubleshooting. If you wish to not display echo back the request
data, then just make the request against the `/noecho` endpoint.
Expand Down Expand Up @@ -90,16 +90,16 @@ See usage examples for Kubernetes, Kong for Kubernetes Ingress Controller, and d

### With Docker ###

Docker image is Alpine 3.11 based running PHP 7.3 on Apache. The containter exposes both ports 80 an 443 with a self signed certificated. If you wish to alter the container configuration, feel free to use the Dockerfile in this repo (https://github.com/yesinteractive/dad-jokes_microservice/blob/master/Dockerfile). Otherwise, you can pull the latest image from DockerHub with the following command:
Docker image is Alpine 3.11 based running PHP 7.3 on Apache. The containter exposes both ports 8100 (HTTP) an 8143 (HTTPS) with a self signed certificated. If you wish to alter the container configuration, feel free to use the Dockerfile in this repo (https://github.com/yesinteractive/dad-jokes_microservice/blob/master/Dockerfile). Otherwise, you can pull the latest image from DockerHub with the following command:
```
docker pull yesinteractive/dadjokes
```
Typical basic usage (below example exposes dadjokes on host ports 8100 and 8143):

```
$ docker run -d \
-p 8100:80 \
-p 8143:443 \
-p 8100:8100 \
-p 8143:8143 \
yesinteractive/dadjokes
```

Expand Down

0 comments on commit 1e9a622

Please # to comment.