Skip to content

Commit

Permalink
Docker: Add development variant for local builds
Browse files Browse the repository at this point in the history
  • Loading branch information
cal0pteryx committed Sep 29, 2021
1 parent 3eb1124 commit 73f7737
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
32 changes: 32 additions & 0 deletions DockerfileDev
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Dockerfile to build a docker image from XSF/xmpp.org Master for development purposes
#
# Dave Cridland <[email protected]>
# Copyright 2017 Surevine Ltd

# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

FROM debian:bullseye
MAINTAINER Dave Cridland <[email protected]>

# Set environment variables
ENV DEBIAN_FRONTEND noninteractive

# Update system
RUN apt-get update && apt-get dist-upgrade -y && apt-get autoremove -y && apt-get clean

# Install dependencies.
RUN apt-get install -y hugo python3 python3-pip && pip3 install requests

# Build and copy in place.
WORKDIR /var/tmp/src/xmpp.org
COPY . /var/tmp/src/xmpp.org
RUN cd /var/tmp/src/xmpp.org && make prepare_docker

FROM nginx
COPY deploy/xsf.conf /etc/nginx/conf.d/default.conf
COPY --from=0 /var/tmp/src/xmpp.org/public/ /var/www/html/
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ help:
@echo ' make clean remove the generated files '
@echo ' make publish generate using production settings '
@echo ' make serve serve site at http://localhost:1313'
@echo ' make prepare_docker prepare site for serving via docker'
@echo ' make ssh_upload upload the web site via SSH '
@echo ' make rsync_upload upload the web site via rsync+ssh '
@echo ' make dropbox_upload upload the web site via Dropbox '
Expand All @@ -49,7 +50,12 @@ clean:
serve:
$(PY) $(TOOLSDIR)/prepare_xep_list.py
$(HUGO) version
$(HUGO) server --bind=0.0.0.0
$(HUGO) server --bind=0.0.0.0 --baseURL="http://localhost/"

prepare_docker:
$(PY) $(TOOLSDIR)/prepare_xep_list.py
$(HUGO) version
$(HUGO) --baseURL="http://localhost/"

publish:
$(PY) $(TOOLSDIR)/prepare_xep_list.py
Expand Down
6 changes: 3 additions & 3 deletions MakefileDocker
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#
# Build a docker image to build the website
# Build a docker image to build the website locally (for development)
#

all:
docker build -t xmpp-org/latest .
docker build -t xmpp-dockerdev -f ./DockerfileDev .

serve:
docker run -p 80:80 -t -i xmpp-org/latest
docker run -p 80:80 -t -i xmpp-dockerdev

0 comments on commit 73f7737

Please sign in to comment.