diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..06b2ab9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +data/* +!data/.gitkeep diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..7356467 --- /dev/null +++ b/LICENCE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Guillaume 'B.B.' Van Hemmen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ab5af06..f1b5eca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,65 @@ -# factorio +# Factorio +## Introduction + +This repository is a Docker Compose setup based on the work +from [factoriotools/factorio-docker](https://github.com/factoriotools/factorio-docker). Please consult their repository +for the full source and documentation. + +[Factorio](https://www.factorio.com) is a game where you build and maintain factories. You will mine resources, research +technologies, build infrastructure, automate production, and fight enemies. Use your imagination to design your factory, +combine simple elements into ingenious structures, apply management skills to keep it working, and protect it from +creatures who don't really like you. + +The game is stable and optimized for building massive factories. You can create your own maps, write mods in Lua, or +play with friends via multiplayer. + +## Table of Contents + +- [Introduction](#introduction) +- [Prerequisites](#prerequisites) +- [Installation](#installation) +- [Usage](#usage) +- [License](#license) + +## Prerequisites + +- **Docker**: Ensure Docker is installed and running on your system. +- **Docker Compose**: Docker Compose is required to orchestrate the container setup. + +## Installation + +1. Clone the repository: + ```bash + git clone https://git.van-hemmen.com/GuillaumeHemmen-DockerCompose-Infra/factorio.git + cd factorio + ``` + +2. Ensure that the data folder has the proper ownership (use sudo if needed): + ```bash + sudo chown 845:845 ./data + ``` + +3. Run the server once: + ```bash + docker compose up + ``` + +4. Stop the server: + ```bash + docker compose down + ``` + +5. Customize the server via the `server-settings.json` file that appeared in the data folder. + +## Usage + +Start the Factorio service with Docker Compose: + +```bash +docker compose up -d +``` + +## License + +This project is licensed under the terms of the MIT license. See the [LICENSE](LICENSE) file for details. diff --git a/data/.gitkeep b/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..84fd70d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,23 @@ +volumes: + app: + +services: + + app: + image: factoriotools/factorio:latest + ports: + - target: 34197 + published: 34197 + protocol: udp + mode: host + - target: 27015 + published: 27015 + protocol: tcp + mode: host + volumes: + - ./testFolder:/factorio + deploy: + replicas: 1 + restart_policy: + condition: any + delay: 5s