This repository has been archived by the owner on May 20, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
simplify reverse proxy (#98)
make use of mainline nginx image, switch ssl/non-ssl config file based on presence of cert/key, hardcode app port since it is hardcoded in the app container as well
- Loading branch information
Showing
7 changed files
with
15 additions
and
48 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
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
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
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 |
---|---|---|
@@ -1,22 +1,9 @@ | ||
FROM ubuntu:14.04 | ||
FROM nginx:mainline | ||
|
||
RUN apt-get update && apt-get install -y nginx | ||
|
||
RUN rm /etc/nginx/sites-enabled/default | ||
|
||
COPY mattermost /etc/nginx/sites-available/ | ||
COPY mattermost-ssl /etc/nginx/sites-available/ | ||
ADD docker-entry.sh / | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY ./mattermost /etc/nginx/sites-available/ | ||
COPY ./mattermost-ssl /etc/nginx/sites-available/ | ||
|
||
COPY docker-entry.sh / | ||
RUN chmod +x /docker-entry.sh | ||
|
||
# You can see the logs using `docker-compose logs web`. | ||
RUN ln -sf /dev/stdout /var/log/nginx/access.log | ||
RUN ln -sf /dev/stderr /var/log/nginx/error.log | ||
|
||
# Define working directory. | ||
WORKDIR /etc/nginx | ||
|
||
ENTRYPOINT /docker-entry.sh | ||
|
||
EXPOSE 80 443 |
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#!/bin/bash | ||
echo Starting Nginx | ||
sed -Ei "s/APP_PORT/$PLATFORM_PORT_80_TCP_PORT/" /etc/nginx/sites-available/mattermost | ||
sed -Ei "s/APP_PORT/$PLATFORM_PORT_80_TCP_PORT/" /etc/nginx/sites-available/mattermost-ssl | ||
if [ "$MATTERMOST_ENABLE_SSL" = true ]; then | ||
ssl="-ssl" | ||
if [ -f "/cert/cert.pem" -a -f "/cert/key-no-password.pem" ]; then | ||
echo "found certificate and key, linking ssl config" | ||
ssl="-ssl" | ||
else | ||
echo "linking plain config" | ||
fi | ||
ln -s /etc/nginx/sites-available/mattermost$ssl /etc/nginx/sites-enabled/mattermost | ||
ln -s /etc/nginx/sites-available/mattermost$ssl /etc/nginx/conf.d/mattermost.conf | ||
nginx -g 'daemon off;' |
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
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