Coder Social home page Coder Social logo

server's Introduction

My dead simple setup for self-hosting applications with docker-compose (and traefik).

This config self-sign new applications automatically and make them available to the URL of your choice.

Prerequisite

  • A server with a working installation of docker and docker-compose
  • A domain with the following DNS records:
Type    Name     Value
A       @        <VPS_IP>

This record tells that the URL example.com should point to the VPS IP.

Type    Name     Value
A       *        <VPS_IP>

This record tells that the URLs *.example.com should point to the VPS IP.

Install

  1. Clone the repository
  2. Create an acme.json file
  3. Copy all the .env.example files to .env
  4. Fill the .env files with your config
  5. Run docker compose up

How to

Add a new application

  1. Create and configure a new compose service apps/newapp/newapp.yml
version: "3.3"

services:
  newapp:
    image: <DOCKER_IMAGE>
    container_name: "newapp"
    labels:
      - "traefik.enable=true"
      - "traefik.http.services.newapp.loadBalancer.server.port=<EXPOSED_PORT_BY_CONTAINER>"
      - "traefik.http.routers.newapp.rule=Host(`newapp.${BASE_DOMAIN}`)"
      - "traefik.http.routers.newapp.entrypoints=websecure"
      - "traefik.http.routers.newapp.tls.certresolver=myresolver"

Replace <DOCKER_IMAGE> and <EXPOSED_PORT_BY_CONTAINER>.

  1. List the application in the root docker-compose.yml:
newapp:
  extends:
    file: apps/newapp/newapp.yml
    service: newapp
  1. It should create an app available at https://newapp.example.com 🚀

Upgrade an app

docker-compose up -d --force-recreate --no-deps --build app

server's People

Contributors

baptistearno avatar

Stargazers

 avatar Kuldeep avatar Asty' avatar Michael lima avatar Abdessalaam avatar Jonathan DUMONT avatar nicole avatar ash avatar Kevin Firko avatar Oğuzhan Aydın avatar Pierre Leroux avatar  avatar Thomas Harr avatar Adriel Zimbril avatar hxr avatar Sachin Kumar avatar Pedro Peña avatar Jorgelig avatar Angelo Maiorano avatar Youqing Han avatar Harish Karumuthil avatar Guillaume Dumoulin avatar Yann Coleu avatar

Watchers

Jonathan DUMONT avatar  avatar  avatar

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.