summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Witt <feuerrot@feuerrot.org>2019-04-13 23:49:49 +0200
committerMarkus Witt <feuerrot@feuerrot.org>2019-05-03 22:36:12 +0200
commit386d56a20e2ba1f98bde896897cc4e96b6dd75dc (patch)
tree69cf6b901afadc1fc11962ad927b9e89149e2fd7
parent122e2a7b4a5a994b5a55bafd7304aa879f3bd17b (diff)
Add a basic docker file
-rw-r--r--.dockerignore6
-rw-r--r--.gitignore61
-rw-r--r--Dockerfile30
-rwxr-xr-xdocker-run.sh12
4 files changed, 109 insertions, 0 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..939fd11
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,6 @@
+Dockerfile
+.dockerignore
+examples/
+.gitignore
+README.md
+travelynx.conf
diff --git a/.gitignore b/.gitignore
index f93666b..29532a7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,62 @@
/travelynx.conf
+
+# Created by https://www.gitignore.io/api/vim,perl
+# Edit at https://www.gitignore.io/?templates=vim,perl
+
+### Perl ###
+!Build/
+.last_cover_stats
+/META.yml
+/META.json
+/MYMETA.*
+*.o
+*.pm.tdy
+*.bs
+
+# Devel::Cover
+cover_db/
+
+# Devel::NYTProf
+nytprof.out
+
+# Dizt::Zilla
+/.build/
+
+# Module::Build
+_build/
+Build
+Build.bat
+
+# Module::Install
+inc/
+
+# ExtUtils::MakeMaker
+/blib/
+/_eumm/
+/*.gz
+/Makefile
+/Makefile.old
+/MANIFEST.bak
+/pm_to_blib
+/*.zip
+
+### Vim ###
+# Swap
+[._]*.s[a-v][a-z]
+[._]*.sw[a-p]
+[._]s[a-rt-v][a-z]
+[._]ss[a-gi-z]
+[._]sw[a-p]
+
+# Session
+Session.vim
+
+# Temporary
+.netrwhist
+*~
+# Auto-generated tag files
+tags
+# Persistent undo
+[._]*.un~
+
+# End of https://www.gitignore.io/api/vim,perl
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..b8dd2d7
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,30 @@
+FROM debian:stretch
+
+RUN apt-get update && apt-get install -y \
+ cpanminus \
+ build-essential \
+ libpq-dev \
+ git \
+ ssmtp
+
+RUN cpanm -in \
+ Cache::File \
+ Crypt::Eksblowfish \
+ DateTime \
+ DateTime::Format::Strptime \
+ DBI \
+ DBD::Pg \
+ Email::Sender \
+ Geo::Distance \
+ Geo::Distance::XS \
+ Mojolicious \
+ Mojolicious::Plugin::Authentication \
+ Travel::Status::DE::IRIS \
+ UUID::Tiny \
+ JSON
+
+COPY . /app
+WORKDIR /app
+
+
+CMD /app/docker-run.sh \ No newline at end of file
diff --git a/docker-run.sh b/docker-run.sh
new file mode 100755
index 0000000..b438a19
--- /dev/null
+++ b/docker-run.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+set -eu
+
+if [ ! -f travelynx.conf ]
+then
+ echo "The configuration file is missing"
+ exit 1
+fi
+
+perl index.pl database migrate
+
+exec /usr/local/bin/hypnotoad -f index.pl \ No newline at end of file