Public | Automated Build

Last pushed: 2 years ago
Short Description
Providing typesafe activator, designed to launch play applications (multiple versions)
Full Description

play-framework

Docker image which provides a typesafe activator 1.3.2, designed to launch play applications (v2.3+).

  • Activator: 1.3.2
  • Play version: 2.3.8
  • Java: Oracle-jdk-8u45
  • OS: CentOS-7

Run your app

Your play app has to be mounted in the container in the /app directory. Should you want to publish your app port to the host, you must use the -p argument.

Here is an example of a docker run command:

docker run -d \
  -v /path/to/your/play/app:/app:rw \
  -p 80:9000 \
  ingensi/play-framework

In some cases, you'll need to run play with the current user:

docker run -d \
  -v /path/to/your/play/app:/app:rw \
  -p 80:9000 \
  -u $(id -u)
  ingensi/play-framework

You can also package your app, in order to do that, create a Dockerfile like it:

FROM ingensi/play-framework:latest
MAINTERNER <your@email.com>

ADD /path/to/my/play-src /app

Image inheritance

This docker image inherits from the ingeni/oracle-jdk image. It includes an oracle jdk install in its latest version.

Docker Pull Command
Owner
ingensi
Source Repository

Comments (8)
luizpcam
10 months ago

@visteras ... put tty:true on docker-compose.yml and rebuild!

version: '2'
services:
web:
build: .
ports:

- "9000:9000"
- "9999:9999"
- "8888:8888"
tty: true
visteras
a year ago

After start app in container i have a

[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[info] p.c.s.NettyServer - Stopping server...

why???

desuex
a year ago

It just stops right after netty server is started, what's wrong?

[info] Done updating.

--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.NettyServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

[info] p.c.s.NettyServer - Stopping server...
rafiqul
2 years ago

Hi,
If I create a container in an interactive mode with a command like:
docker run -i -t ubuntu /bin/bash

In this mode I install playframework and create an play App, then how do I make connectivity with postgres container for DB connectivity. Thanks.

javierseixas
2 years ago

The image is working fine for me, but when I change the host port to 8088, or 9000 for example, it doesn't work and I get the following error. Any idea why?

[info] Done updating.
[info] Setting up Play fork run ... (use Ctrl+D to cancel)
[info] Stopping Play fork run ...
[info] Forked Play process did not exit on its own, terminating it
Exception in thread "Thread-2" java.io.IOException: Stream closed
    at java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:170)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:283)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
    at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
    at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
    at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
    at java.io.InputStreamReader.read(InputStreamReader.java:184)
    at java.io.BufferedReader.fill(BufferedReader.java:161)
    at java.io.BufferedReader.readLine(BufferedReader.java:324)
    at java.io.BufferedReader.readLine(BufferedReader.java:389)
    at sbt.BasicIO$$anonfun$processFully$1$$anonfun$apply$8.apply(ProcessImpl.scala:58)
    at sbt.BasicIO$$anonfun$processFully$1$$anonfun$apply$8.apply(ProcessImpl.scala:58)
    at sbt.BasicIO$.readFully$1(ProcessImpl.scala:63)
    at sbt.BasicIO$.processLinesFully(ProcessImpl.scala:69)
    at sbt.BasicIO$$anonfun$processFully$1.apply(ProcessImpl.scala:58)
    at sbt.BasicIO$$anonfun$processFully$1.apply(ProcessImpl.scala:55)
    at play.sbt.forkrun.PlayForkProcess$$anonfun$2.apply$mcV$sp(PlayForkProcess.scala:48)
    at play.sbt.forkrun.PlayForkProcess$$anon$1.run(PlayForkProcess.scala:120)
    at java.lang.Thread.run(Thread.java:745)
[success] Total time: 134 s, completed Jul 18, 2015 10:29:22 AM
maxaudrin
2 years ago

Thanks for the container! It would be nice to add version 2.3.9 and 2.4 ;)

marminthibaut
3 years ago

Did you try to watch your app logs?

You should also run the container as following:

docker run -it \
  -v /path/to/your/play/app:/app:rw \
  -p 80:9000 \
  ingensi/play-framework

Then you'll see what really append into the container.

ckbtovar
3 years ago

I followed the instructions but the container closes once the server starts and exits with a status of 0. Is there something else missing?