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 docker compose #28

Open
wants to merge 36 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b79bed4
Add docker-compose file
RCM7 Aug 4, 2016
67726db
Add docker-compose instructions to Readme.md
RCM7 Aug 4, 2016
bf0d759
Add docker-compose file
RCM7 Aug 4, 2016
8a7ea22
Add docker-compose instructions to Readme.md
RCM7 Aug 4, 2016
65821df
Add environment support to specify the saves and mods directories.
bcrochet Aug 20, 2016
82f5bbd
Merge branch 'bcrochet-add-docker-compose' into add-docker-compose
RCM7 Oct 6, 2016
76f63b1
Remove redundant code
RCM7 Oct 6, 2016
a44ab07
Merge branch 'bcrochet-add-docker-compose' into add-docker-compose
RCM7 Oct 7, 2016
7720dce
Updated to v0.13.14-experimental
bkuhl Aug 8, 2016
beeea10
Updated to v0.13.15-experimental
bkuhl Aug 8, 2016
9e67c12
Updated to v0.13.14-experimental
Aug 17, 2016
71ddeb2
Updated to v0.13.16-experimental
bkuhl Aug 17, 2016
3198368
Showing docker version
bkuhl Aug 17, 2016
5c44922
Reverted to 0.13.15
bkuhl Aug 17, 2016
d0e90a9
Updated to v0.13.16-experimental
bkuhl Aug 17, 2016
9785d47
Updated to v0.13.20
Sep 20, 2016
06929ba
Updated to v0.14.0-experimental
Sep 20, 2016
756879a
Updated to v0.14.1-experimental
Sep 20, 2016
4dde549
Updated to v0.14.2-experimental
Sep 20, 2016
2422f27
Updated to v0.14.3-experimental
Sep 20, 2016
e0559ed
Updated to v0.14.4-experimental
Sep 20, 2016
10a030a
Updated to v0.14.5-experimental
Sep 20, 2016
17c1c8e
Updated to v0.14.6-experimental
Sep 20, 2016
7635d23
Updated to v0.14.7-experimental
Sep 20, 2016
a7467c4
Trying to fix master build of the travis CI
zopanix Sep 20, 2016
2dcd0c3
Changed readme
zopanix Sep 20, 2016
6f863fc
Update README.md
bkuhl Sep 20, 2016
b9347a8
Update README.md
bkuhl Sep 20, 2016
1d50210
Updated to v0.14.8-experimental
bkuhl Sep 20, 2016
e58f7bf
Add docker-compose file
RCM7 Aug 4, 2016
764ab1a
Add docker-compose instructions to Readme.md
RCM7 Aug 4, 2016
bd940bb
Add environment support to specify the saves and mods directories.
bcrochet Aug 20, 2016
0c69184
Remove redundant code
RCM7 Oct 6, 2016
1bc3835
Make tag in comment and README version independent
RCM7 Oct 7, 2016
bbff761
Merge branch 'add-docker-compose' of github.com:RCM7/docker_factorio_…
RCM7 Oct 7, 2016
22d2bf6
Fix leftovers of merge in README
RCM7 Oct 7, 2016
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 .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.env
saves
mods

6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ before_install:
# see https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
script:
- docker build -t "zopanix/factorio:${TRAVIS_TAG}" .
- |
if [ -z "$TRAVIS_TAG" ]; then
TRAVIS_TAG="latest"
fi
docker build -t "zopanix/factorio:${TRAVIS_TAG}" .
deploy:
provider: script
script: docker tag "zopanix/factorio:${TRAVIS_TAG}" "zopanix/factorio:latest" && docker push "zopanix/factorio:${TRAVIS_TAG}" && docker push "zopanix/factorio:latest"
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ ENV FACTORIO_AUTOSAVE_INTERVAL=2 \
FACTORIO_ALLOW_COMMANDS=false \
FACTORIO_NO_AUTO_PAUSE=false \
FACTORIO_LATENCY_MS=100 \
VERSION=0.13.16 \
FACTORIO_SHA1=52de126ce47bf24b795db07ff83ed13f8f537c0c \
VERSION=0.14.8 \
FACTORIO_SHA1=db71bd07aeb8b3775c9254597eaf5af858c84b7d \
FACTORIO_WAITING=false \
FACTORIO_MODE=normal \
FACTORIO_SERVER_NAME= \
Expand Down
42 changes: 34 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
Factorio
Factorio [![Build Status](https://travis-ci.org/zopanix/docker_factorio_server.svg?branch=master)](https://travis-ci.org/zopanix/docker_factorio_server) [![Docker Pulls](https://img.shields.io/docker/pulls/zopanix/factorio.svg?maxAge=2592000)](https://hub.docker.com/r/zopanix/factorio/)
=====
Factorio Server in docker

[![Build Status](https://travis-ci.org/zopanix/docker_factorio_server.svg?branch=master)](https://travis-ci.org/zopanix/docker_factorio_server)

Current Version
Versions
-----
0.13.13
Please checkout the different [tags](https://hub.docker.com/r/zopanix/factorio/tags/)

### What's new ?
#### Factorio
See [factorio's site](http://www.factorio.com)
#### Docker image
* New semver for version !!!Tags have changed now!!!
* Automated build with travis

Versions
-----
I'm keeping the image up to date. If you need to use an older version, checkout out the different [tags](https://hub.docker.com/r/zopanix/factorio/tags/).

How to use ?
-----
Expand Down Expand Up @@ -217,6 +213,36 @@ Error Util.cpp:57: Unknown error
```
Check supplied Username and Password for mistakes.

### Docker Compose
You may use docker-compose to easily setup your game server using the following command:

`docker-compose up -d`

that will run the container as a service in the background automatically.
You may change the file content according to your preferences.

Also if you want to setup your game server via docker-compose without having to build the image every time or even to download this repo, just copy the docker-compose.yml file and comment the line:

`build: .`

and uncomment the line:

`#image: zopanix/factorio:TAG`

changing the tag to whatever you want to install.

This way docker will automatically pull the image from the Docker Hub with the version you specified without the need for any build.

The saves directory and the mods directory must be specified either in the environment before running `docker-compose up -d`:

`
export FACTORIO_SAVES_DIR=./save
export FACTORIO_MODS_DIR=./mods
docker-compose up -d
`

Or, just copy the env.sample to .env and modify as appropriate.

#### Waiting for ready
This is a beta feature which has nothing to do with factorio... leave it as it is for the moment. I'm working with some collegues on something new which should work very well and please a lot of people.

Expand Down
17 changes: 17 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: '2'
services:
game:
build: .
#image: zopanix/factorio:TAG
volumes:
- ./saves:/opt/factorio/saves
- ./mods:/opt/factorio/mods
ports:
- "34197:34197/udp"
environment:
Copy link
Contributor

Choose a reason for hiding this comment

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

Defaults for the environment are already provided in the Dockerfile, is there a need to redefine them?

- ${FACTORIO_SAVES_DIR}:/opt/factorio/saves:Z
- ${FACTORIO_MODS_DIR}:/opt/factorio/mods:Z
ports:
- "34197:34197/udp"
restart: always

3 changes: 3 additions & 0 deletions env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FACTORIO_SAVES_DIR=./save
FACTORIO_MODS_DIR=./mods