Skip to content

Commit

Permalink
Merge pull request #421 from mpsonntag/docker
Browse files Browse the repository at this point in the history
Docker changes
  • Loading branch information
achilleas-k authored Dec 10, 2018
2 parents 1c02db9 + 7f7fd37 commit 929fa0d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ cache:
- $HOME/.ivy2
- $HOME/.sbt
jdk:
- oraclejdk7
- oraclejdk8
env:
- ACTIVATOR_VERSION=1.3.7
before_script:
Expand Down
11 changes: 8 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ENV PATH /usr/local/activator-${ACTIVATOR_VERSION}-minimal:$PATH

# install to srv gca
RUN mkdir -p /srv/gca
RUN mkdir -p /srv/gca/figures
RUN mkdir -p /srv/gca/figures_mobile

ADD app /srv/gca/app
ADD conf /srv/gca/conf
Expand All @@ -25,6 +27,7 @@ ADD startup.sh /srv/gca
ADD figures /srv/gca/figures
ADD figures_mobile /srv/gca/figures_mobile

# only required for local tests
RUN mkdir -p /srv/gca/db
RUN echo "db.default.url=\"jdbc:h2:/srv/gca/db/gca-web\"" >> /srv/gca/conf/application.dev.conf

Expand All @@ -33,13 +36,15 @@ WORKDIR /srv/gca
# Required to get dependencies before running the startup script.
RUN activator test stage

# Make sure we always have the latest routes file available
# even if we use a config folder from outside the container.
RUN mkdir -p /srv/tmp
RUN cp /srv/gca/conf/routes /srv/tmp/routes

VOLUME ["/srv/gca/db"]
VOLUME ["/srv/gca/conf"]
VOLUME ["/srv/gca/figures"]
VOLUME ["/srv/gca/figures_mobile"]

EXPOSE 9000
ENTRYPOINT ["/bin/bash", "startup.sh"]

# Previous entrypoint using the staged binary
#ENTRYPOINT ["target/universal/stage/bin/gca-web"]
6 changes: 3 additions & 3 deletions startup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Use tests to set up a database in a test environment
activator test stage
activator start
cp /srv/tmp/routes /srv/gca/conf/routes

activator run

0 comments on commit 929fa0d

Please sign in to comment.