Git Product home page Git Product logo

make-my-server's Introduction

Server configuration

Discord

Your (my) own server configuration, managed by docker-compose, with comprehensive default configuration.

Setup

IF you are using docker compose version <2.20, you need to use the following bash command to use this project:

docker-compose ()
{
    docker-compose $(find -name 'docker-compose.*.yml' -type f -printf '%p\t%d\n'  2>/dev/null | sort -n -k2 | cut -f 1 | awk '{print "-f "$0}') $@
}

Run

SITE=tom.moulard.org docker-compose up -d

Now you have your own server configuration.

To be a little more consistent with the management, you can use a .env file and do:

cp .env.default .env

And edit the .env file to use the correct configuration.

The docker-compose function gather all docker-compose files in order to have the whole configuration in one place (see docker-compose config).

Tear down

docker-compose down

Services list

There should be only one service by folder: For example, le folder traefik/ contains all the necessary configuration to run the traefik service.

Thus each folder represent an available service.

The directory must follow the following architecture:

service/
├── conf
│   └── ...
├── data
│   └── ...
├── docker-compose.servicename.yml
├── logs
│   ├── access.log
│   └── error.log
└── README.md

If the service you are adding can use volumes:

  • data/, is where to store to service data
  • conf/, is where to store to service configuration
  • logs/, is where to store to service logs (others than Docker logs)

Feel free to do a Pull Request to add your ideas.

more ideas

Configuration

Don't forget to change:

  • db passwords (might not be needed since they are beyond the reverse proxy)
  • VPN secrets (if none provided, they are generated directly).

Configuration files are: docker-compose.yml, nginx.conf

To set the password:

echo "USERS=$(htpasswd -nB $USER)" >> .env

You can add a new set of credentials by editing the .env file like

USERS=toto:pass,tata:pass, ...

The .env.default is generated using this command:

grep '${' **/docker-compose.*.yml | sed "s/.*\${\(.*\)}.*/\1/g" | cut -d":" -f 1 | sort -u | sort | xargs -I % echo "%=" >> .env.default

For local developments

Edit the file /etc/hosts to provide the reverse proxy with good URLs.

For example, adding this in your /etc/hosts will allow to run and debug the Traefik service locally:

127.0.0.1   traefik.moulard.org

Scaling up

docker-compose scale nginx=2

Tests

Lint

! Warning: This is enforced for all PRs.

We are using yamllint to lint our yaml files. You can install it by looking at the official documentation.

Once installed, you can run the following command to lint all the yaml files:

yamllint .

docker-compose config

! Warning: This is enforced for all PRs.

You can run the following command to check that the docker-compose files are correctly written:

./test.sh

It tests that:

  • all docker-compose files are valid
  • all docker-compose files are parsable
  • all docker-compose files are consistent with the test_config.yml file
  • all environment variables are set inside the .env.default file

Once this shell scritp is run, if the tests failes, you can see a bunch of modified files (e.g., test_config.yml) that indicates what is wrong.

Note that the GitHub Action will run this script for you, and provides a patch.patch file that should solve most of your issues.

Authors

Main author:

Gitlab helper:

Discord MusicBot/minecraft:

make-my-server's People

Contributors

nitra-mfs avatar sailreal avatar tommoulard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

make-my-server's Issues

Feature request

This might be a good thing to add a letsencrypt service with a shared volume to have SSL certificates for every subdomain you have for your services!

Keep the good work ! 💯

I tried to get the gitlab part to work but it didnt work.

So I erased everything leaving only the gitlab and gitlab runner. Also left the gitlab/config untouched.

runner_1 | ERROR: Failed to load config stat /etc/gitlab-runner/config.toml: no such file or directory builds=0

Does need all the other things to get gitlab started?

local file

hello

dans ta ligne

- './cyprine:/etc/nginx/conf.d'

tu fait référence a un fichier sur ton serveur, tu ferais pas mieux d'utiliser la référence a un fichier dans le GIT ?

dans mon dokerfile https://github.com/gmoulard/pi-appliance/blob/master/docker-apache/dockerfile.php.mariadb
je fait un truc
COPY etc/apache2/sites-available/* /etc/apache2/sites-available/

qui intergre alors les fichiers de https://github.com/gmoulard/pi-appliance/tree/master/docker-apache/etc/apache2/sites-available

G.

Use the .env file

I see that you use export VAR=value but you can use the .env file documentation

And you can then provide a .env.example file on the repository to centralize all environnent variables

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.