From ec285bb5fd692831fff5c48d598987c594ec1e8f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 2 Dec 2018 15:32:18 +0000 Subject: [PATCH] Add docker container for testing Signed-off-by: Michael Tremer --- Dockerfile | 43 +++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 5 +++++ 2 files changed, 48 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..c59ddb03 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +FROM centos:latest + +EXPOSE 80 + +# Enable EPEL +RUN yum install -y epel-release + +# Install all updates +RUN yum update -y + +# Install required packages +RUN yum install -y \ + autoconf \ + automake \ + curl-devel \ + gcc \ + make \ + openldap-devel \ + python34 \ + python34-devel \ + python34-pip \ + sassc \ + \ + /usr/share/hwdata/pci.ids \ + /usr/share/hwdata/usb.ids + +# Install Python packages +ADD requirements.txt . +RUN pip3 install -r requirements.txt + +# Copy code into the container +COPY . /build/ipfire.org +WORKDIR /build/ipfire.org + +# Install the webapp +RUN ./autogen.sh && ./configure --prefix=/usr --sysconfdir=/etc \ + && make -j4 && make install + +# Go back to /root +WORKDIR /root + +# Run the webapp +CMD ["ipfire.org-webapp", "--debug", "--logging=debug", "--port=80"] diff --git a/Makefile.am b/Makefile.am index 3e5a059b..b00350b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -975,3 +975,8 @@ SED_PROCESS = \ src/scss/main.css: $(SCSS_FILES) Makefile $(AM_V_GEN)$(MKDIR_P) $(dir $@) && \ $(SASSC) --style compressed $< > $@ + +# Docker +.PHONY: docker +docker: Dockerfile + docker build -t "ipfire/webapp:$(PACKAGE_VERSION)" . -- 2.47.2