我在AWS Beanstalk上使用Docker运行Play Framework应用程序(运行Docker 1.6.0的64位Amazon Linux 2015.03 v1.4.1)。
Docker文件:
FROM relateiq/oracle-java8
MAINTAINER XXXX
EXPOSE 9000
ADD files /
WORKDIR /opt/docker
RUN ["chown", "-R", "daemon", "."]
RUN ["chmod", "+x", "bin/app"]
USER daemon
ENTRYPOINT ["bin/app"]
CMD []
Dockerrun.aws.json
{
"AWSEBDockerrunVersion": "1",
"Ports": [{
"ContainerPort": "9000"
}]
}
当实例首次启动时,我会在正常情况下部署大约1分钟,然后在浏览几页后错误显示:
502 Bad Gateway
nginx/1.6.2
ElasticBeanstalk日志中的错误是:
Play server process ID is 1 This application is already running (Or delete /opt/docker/RUNNING_PID file).
我每隔30秒也会收到/var/log/docker-events.log
以下消息:
2015-05-30T20:07:58.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) start
2015-05-30T20:08:15.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) die
2015-05-30T20:08:16.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) start
2015-05-30T20:08:31.000000000Z d0425e47095e5e2637263a0fe9b49ed759f130f31c041368ea48ce3d99d1e947: (from aws_beanstalk/current-app:latest) die
有人能看到我的问题吗?欢呼声。
答案 0 :(得分:0)
在build.sbt
中添加以下内容可以解决此问题:
javaOptions in Universal ++= Seq("-Dpidfile.path=/dev/null")