Last active
March 18, 2019 18:32
-
-
Save vonKrafft/bc74bd9c90c6bbe19f07729c42ffc0f4 to your computer and use it in GitHub Desktop.
Une interface Web pour IRC avec Docker (https://vonkrafft.fr/console/interface-web-pour-irc-avec-docker/)
This file contains hidden or 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
#!/bin/bash | |
mkdir -p docker-irc/www # Webroot dans lequel sera stocké le contenu statique du site | |
mkdir -p docker-irc/log # Pour enregistrer les journaux de Nginx | |
mkdir -p docker-irc/weechat # Pour stocker les données weechat | |
groupadd -g 1000 weechat | |
useradd -u 1000 -M -p '*' -s /bin/false -g 1000 weechat | |
mkdir -p /docker/web-irc/weechat | |
chown 1000:1000 /docker/web-irc/weechat | |
docker build -t vonkrafft/weechat:latest ./docker-irc/.build-weechat | |
docker run --rm -it -v "./docker-irc/weechat:/weechat/.weechat" vonkrafft/weechat:latest weechat | |
git clone https://github.com/glowing-bear/glowing-bear.git ./docker-irc/www | |
rm -r ./docker-irc/www/.git | |
docker-compose up -d |
This file contains hidden or 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
version: '2' | |
services: | |
web-irc: | |
image: nginx:stable-alpine | |
container_name: web-irc | |
volumes: | |
- "./docker-irc/www:/usr/share/nginx/html:ro" | |
- "./docker-irc/log:/var/log/nginx" | |
- "./docker-irc/default.conf:/etc/nginx/conf.d/default.conf:ro" | |
ports: | |
- "80:80" | |
weechat: | |
container_name: weechat | |
image: vonkrafft/weechat:latest | |
volumes: | |
- "./docker-irc/weechat:/weechat/.weechat" | |
tty: true |
This file contains hidden or 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
FROM alpine:latest | |
MAINTAINER vonKrafft <[email protected]> | |
RUN apk add --update weechat python bash \ | |
&& rm -rf /var/cache/apk/* | |
ENV LANG C.UTF-8 | |
ENV HOME /weechat | |
RUN mkdir -p $HOME/.weechat \ | |
&& addgroup -g 1000 weechat \ | |
&& adduser -h $HOME -D -s /bin/bash -G weechat -u 1000 weechat \ | |
&& chown -R weechat:weechat $HOME | |
VOLUME ["/weechat/.weechat"] | |
WORKDIR $HOME | |
USER weechat | |
EXPOSE 9001 | |
CMD ["weechat"] |
This file contains hidden or 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
server { | |
listen 80; | |
server_name irc.docker.local; | |
access_log /var/log/nginx/access.log main; | |
error_log /var/log/nginx/error.log warn; | |
location / { | |
root /usr/share/nginx/html; | |
index index.html index.htm; | |
} | |
location /weechat { | |
proxy_pass http://weechat:9001/weechat; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment