Skip to content

Commit

Permalink
Merge pull request #3 from DaoCloud/hotfix/container-id
Browse files Browse the repository at this point in the history
show 2048 container id on website with one question
  • Loading branch information
pikeszfish authored Sep 19, 2016
2 parents 4473c45 + efadbf4 commit 0f025d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
# Using a compact OS
FROM alpine:latest

MAINTAINER Golfen Guo <[email protected]>
MAINTAINER Golfen Guo <[email protected]>

# Install and configure Nginx
RUN apk --update add nginx
RUN sed -i "s#root html;#root /usr/share/nginx/html;#g" /etc/nginx/nginx.conf
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log

# Add 2048 stuff into Nginx server
COPY . /usr/share/nginx/html

EXPOSE 80

# Start Nginx and keep it from running background
CMD ["nginx", "-g", "pid /tmp/nginx.pid; daemon off;"]

# Start Nginx and keep it running background and start php
CMD sed -i "s/ContainerID: /ContainerID: "$(hostname)"/g" /usr/share/nginx/html/index.html && nginx -g "pid /tmp/nginx.pid; daemon off;"
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</head>
<body>
<div class="container">
<p style="position:absolute;left:60px;top:100px;">ContainerID: </p>
<div class="heading">
<h1 class="title">2048</h1>
<div class="scores-container">
Expand Down

0 comments on commit 0f025d6

Please sign in to comment.