From 5cff390c081bdfb756a8977ad0bd56d778202d6b Mon Sep 17 00:00:00 2001
From: startxfr
Date: Sat, 6 Feb 2016 05:05:57 +0100
Subject: reorg avec gestion des sig
---
Services/apache/Dockerfile | 23 ++++++-------
Services/apache/README.md | 16 ++++-----
Services/apache/docker-compose.yml | 4 +--
Services/apache/index.html | 22 ++++---------
Services/apache/run.sh | 8 +----
Services/apache/sx-httpd.sh | 66 +++++++++++++++-----------------------
6 files changed, 54 insertions(+), 85 deletions(-)
(limited to 'Services/apache')
diff --git a/Services/apache/Dockerfile b/Services/apache/Dockerfile
index 9682a0a..78e7cdc 100644
--- a/Services/apache/Dockerfile
+++ b/Services/apache/Dockerfile
@@ -5,24 +5,21 @@ USER root
RUN dnf -y install httpd && \
dnf clean all
ENV HTTPDCONF=/etc/httpd/conf.d/app.conf \
- STARTUPLOG=/data/logs/apache/startup.log \
- LOG_PATH=/data/logs/apache \
- APP_PATH=/data/apache \
- TMP_APP_PATH=/tmp/apache
+ STARTUPLOG=/logs/startup.log \
+ LOG_PATH=/logs \
+ APP_PATH=/app \
+ DATA_PATH=/data
COPY httpd.conf $HTTPDCONF
COPY *.sh /bin/
RUN chmod 775 /bin/run.sh /bin/sx-httpd.sh && \
chmod ug+r $HTTPDCONF && \
- rm -f /etc/httpd/conf.d/autoindex.conf && \
- rm -f /etc/httpd/conf.d/welcome.conf && \
- mkdir -p $TMP_APP_PATH && \
- mkdir -p $APP_PATH && \
- mkdir -p $LOG_PATH && \
+ rm -f /etc/httpd/conf.d/autoindex.conf /etc/httpd/conf.d/welcome.conf && \
+ mkdir -p $DATA_PATH $APP_PATH $LOG_PATH && \
touch $STARTUPLOG
-COPY ./ $TMP_APP_PATH
-RUN rm -f $TMP_APP_PATH/Dockerfile $TMP_APP_PATH/httpd.conf $TMP_APP_PATH/run.sh $TMP_APP_PATH/sx-httpd.sh && \
- chown -R apache:apache $TMP_APP_PATH $APP_PATH $LOG_PATH
+COPY ./ $APP_PATH
+RUN rm -f $APP_PATH/Dockerfile $APP_PATH/httpd.conf $APP_PATH/run.sh $APP_PATH/sx-httpd.sh && \
+ chown -R apache:apache $APP_PATH $DATA_PATH $LOG_PATH
EXPOSE 80 443
-VOLUME [$APP_PATH,$LOG_PATH]
+VOLUME [$DATA_PATH,$LOG_PATH]
CMD ["/bin/run.sh"]
\ No newline at end of file
diff --git a/Services/apache/README.md b/Services/apache/README.md
index ed737e1..c1ae1a2 100644
--- a/Services/apache/README.md
+++ b/Services/apache/README.md
@@ -30,8 +30,8 @@ service:
CONTAINER_INSTANCE: "service-apache"
SERVER_NAME: "localhost"
volumes:
- - "/tmp/container/logs/apache:/data/logs/apache"
- - "/tmp/container/apache:/data/apache"
+ - "/tmp/container/logs/apache:/logs"
+ - "/tmp/container/apache:/data"
```
## Docker-compose in various situations
@@ -90,8 +90,8 @@ CMD ["/bin/run.sh"]
| CONTAINER_SERVICE | `string` | `no` | Define the type of service or application provided
| SERVER_NAME | `string` | `no` | Server name for this container. If no name localhost will be assigned
| HOSTNAME | `auto` | `auto` | Container unique id automatically assigned by docker daemon at startup
-| LOG_PATH | `auto` | `auto` | default set to /data/logs/apache and used as a volume mountpoint
-| APP_PATH | `auto` | `auto` | default set to /data/apache and used as a volume mountpoint
+| LOG_PATH | `auto` | `auto` | default set to /logs and used as a volume mountpoint
+| APP_PATH | `auto` | `auto` | default set to /data and used as a volume mountpoint
## Exposed port
@@ -104,8 +104,8 @@ CMD ["/bin/run.sh"]
| Container directory | Description |
|----------------------|--------------------------------------------------------------------------|
-| /data/logs/apache | log directory used to record container and apache logs
-| /data/apache | data directory served by apache. If empty will be filled with app on startup. In other case use content from mountpoint or data volumes
+| /logs | log directory used to record container and apache logs
+| /data | data directory served by apache. If empty will be filled with app on startup. In other case use content from mountpoint or data volumes
## Testing the service
@@ -126,8 +126,8 @@ You must have a working environment with the source code of this repository. Rea
1. Jump into the container directory with `cd Services/apache`
2. Build the container using `docker build -t sv-apache .`
3. Run this container
- 1. Interactively with `docker run -p 80:80 -v /data/logs/apache -it sv-apache`. If you add a second parameter (like `/bin/bash`) to will run this command instead of the default entrypoint. Usefull to interact with this container (ex: `/bin/bash`, `/bin/ps -a`, `/bin/df -h`,...)
- 2. As a daemon with `docker run -p 80:80 -v /data/logs/apache -d sv-apache`
+ 1. Interactively with `docker run -p 80:80 -v /logs -it sv-apache`. If you add a second parameter (like `/bin/bash`) to will run this command instead of the default entrypoint. Usefull to interact with this container (ex: `/bin/bash`, `/bin/ps -a`, `/bin/df -h`,...)
+ 2. As a daemon with `docker run -p 80:80 -v /logs -d sv-apache`
### Build & run a container using `docker-compose`
diff --git a/Services/apache/docker-compose.yml b/Services/apache/docker-compose.yml
index 60e4b4f..3c23a4b 100644
--- a/Services/apache/docker-compose.yml
+++ b/Services/apache/docker-compose.yml
@@ -14,5 +14,5 @@ server:
CONTAINER_INSTANCE: "service-apache"
SERVER_NAME: "localhost"
volumes:
- - "/tmp/container/logs/apache:/data/logs/apache"
- - "/tmp/container/apache:/data/apache"
\ No newline at end of file
+ - "/tmp/container/logs/apache:/logs"
+ - "/tmp/container/apache:/data"
\ No newline at end of file
diff --git a/Services/apache/index.html b/Services/apache/index.html
index 039c3dc..f3a9e21 100644
--- a/Services/apache/index.html
+++ b/Services/apache/index.html
@@ -13,14 +13,8 @@
h3 { text-shadow: 1px 1px 0px rgba(255,255,255,1); font-size: 1.5em;margin: .2em; }
h4 { font-size: 1.2em; margin: .2em; }
p { font-size: 1em; margin: .5em .2em; }
- ul {
- padding-bottom: 1em;
- padding-left: 2em;
- }
- a {
- color: white;
- text-decoration: none;
- }
+ ul { font-size: 1em; margin: .5em .2em; padding-bottom: 1em; padding-left: 2em; }
+ a { color: white; text-decoration: none; }
body > header h1 { color: #000e44; text-shadow: 0 0 3px rgb(255,255,255), 0 0 10px rgba(255,255,255,1), 0 0 20px rgba(255,255,255,0.6); float: left }
body > header h1 span { color: #0c6f5e }
body > header h2 { color: white; font-size: .7em; font-weight: normal; margin: 2.2em 0 0 1em; float: left }
@@ -28,8 +22,6 @@
article header { margin: 0;padding: .3em; box-shadow: 0 0 5px rgba(0,0,0,0.9); border-radius: 5px 5px 0 0; width: 892px; }
article h3 { display: inline; }
article > details { margin: 1em; }
-
-
body#error { background-color : #533;}
#error article { color : darkred; background-color : rgba(255,255,255,0.9); clear: both }
#error article h2 { color : white; text-shadow: 0 0 2px white, 0 0 15px #600, 3px 3px 8px rgba(50,0,0,0.9); }
@@ -37,7 +29,6 @@
#error h3, #error article a { color : #744; }
#error article a:hover { color : #533; }
#error pre.xdebug-var-dump {font-size:0.8em}
-
body#answer { background-color : #353 }
#answer article { color : #575;background-color : rgba(255,255,255,0.9); clear: both }
#answer article h2 { color : white; text-shadow: 0 0 2px rgba(11,45,11,0.9), 0 0 10px rgba(11,45,11,0.8); }
@@ -57,12 +48,13 @@
You are actually running an apache webserver running under the latest fedora release. For more information about this container and how to add your content instead of this message, please read the following links.
+
-
-
-
-