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

Add Dockerfile #392

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 4 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
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ubuntu:18.04
Copy link
Contributor

Choose a reason for hiding this comment

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

I see no reason not to just use ubuntu:latest here.


ENV MOTD="Welcome to our Docker Syncplay server!"
ENV PORT=8999
ENV PASSWORD="changethis"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm unsure about having a default password. As it stands the docker file will result in server image that cannot be started in non-passworded mode.

ENV SALT="changethis"
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be no default salt value. Having a single default implies that all default docker images would always end up with the same salt. Which for the most part defeats entire purpose of having it in first place.


RUN apt update
RUN apt-get install -y make python3 python3-twisted python3-pyside
Copy link
Member

Choose a reason for hiding this comment

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

Best practices recommend consolidating these two RUN statements in a single one, see e.g. here: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#run. Perhaps you could also clean up the package index to make the image smaller.


COPY . /syncplay
RUN cd syncplay && make install
Copy link
Contributor

Choose a reason for hiding this comment

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

You can do make install-server instead. Right now the difference is fairly minimal, but it does result in smaller installation.


EXPOSE $PORT

CMD echo $MOTD > motd.txt && syncplay-server --password $PASSWORD --port $PORT --salt $SALT --motd-file motd.txt