From 1ded2fd6ed483c2cea0efa9acb49138f6f5e7b48 Mon Sep 17 00:00:00 2001 From: Roy Ronalds Date: Fri, 9 Mar 2018 21:30:41 -0500 Subject: [PATCH] Created a Dockerfile. --- Dockerfile | 33 +++++++++++++++++++++++++++++++++ README.markdown | 6 ++++++ 2 files changed, 39 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..87b48c183 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ + +FROM richarvey/nginx-php-fpm:1.4.0 +# Comes with alpine linux 3.6 + +ARG username=nw + +WORKDIR ./ + +COPY . . + +ENV DBUSER=nwserver + +# Various preps for alpine environment +RUN echo "Commencing PREP..." && \ + apk add make && \ + apk add --upgrade apk-tools && \ + apk update && \ + apk add nodejs && \ + apk add postgresql && \ + echo "Creating the resources file from the resources.build.php..." && \ + #sed "0,/postgres/{s/postgres/${DBUSER}/}" deploy/resources.build.php > deploy/resources.php && \ + #sed "s|/srv/ninjawars/|../..|g" deploy/tests/karma.conf.js > karma.conf.js && \ + echo "PREP done, starting install..." && \ + ./configure && make && make install && \ + echo "Install not run." + +ENV HOST=0.0.0.0 \ + PORT=7654 + +EXPOSE 7654 + +# Run with: docker run --rm -it -p 7654:7654 nw-server +CMD ["make" "test"] \ No newline at end of file diff --git a/README.markdown b/README.markdown index f2e756e19..d9c04c90e 100644 --- a/README.markdown +++ b/README.markdown @@ -55,6 +55,12 @@ Then you can run the tests to check your progress with: *See ./docs/INSTALL if you need more.* +## Run the Docker + +* Init tagged image: `docker build -t nw-server .` +* Run it: `docker run --rm -it -p 7654:7654 nw-server` +* Stop the container: `docker stop nw-server` + ## To Contribute See CONTRIBUTING.md