Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROSE Server in a Docker Container #309

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
docs/
examples/
Makefile
README*
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Use official CentOS Python 2.7 image
# https://developer.fedoraproject.org/tools/docker/docker-images.html
FROM centos/python-27-centos7 AS base

# Project maintainer
LABEL maintainer="frolland@redhat.com"

# Required env vars
ENV LD_LIBRARY_PATH="/opt/rh/python27/root/usr/lib64/" \
ENABLE_PIPENV=true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need LD_LIBRARY_PATH?


# Install pipenv
RUN pip install --upgrade pipenv
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we used a container, we don't need pipenv.


# Copy application to default WORKDIR
COPY . ./

# Install dependencies from pipfile
RUN pipenv install
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can install the requirements manually, or using a requirements.txt file generated
by pipenv.


# Server port
EXPOSE 8880

# Server command
ENTRYPOINT [ "pipenv" ]
CMD [ "run", "python", "rose-server"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And without pipeenv, we can just run rose-server here.

12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,18 @@ Start the server on some machine:

Open a browser at http://\<server-address\>:8880 to view and control the game.

### Running the server in Docker

Build the Docker image:

docker build -t rose:server .

Run the Docker image on port 8880:

docker run -it --rm -p 8880 rose:server

Open a browser at http://\<server-address\>:8880 to view and control the game.

## Running a driver

Open a pipenv shell that you'll use for the following commands:
Expand Down