GithubHelp home page GithubHelp logo

3sem-traefik-setup's Introduction

Træfik Setup Remote

Requirements

  • DigitalOcean account
  • DockerHub DockerHub account
  • Domain name (could be any provider)
  • Your domain is pointing to DigitalOcean DNS servers
  • Wildcard DNS record for your domain (*.your_domain.com)

Features

Debugging

  • Check if all containers are running with docker ps -a
  • Check if all env variables are set in .env file and are correct
  • Check if docker compose has read all environment variables with docker-compose config
  • Check the logs of the individual container with docker logs <container_name> or docker logs --follow <container_name>
  • Did you remember to add your domain to the DigitalOcean DNS servers?
  • Did you remember to add a wildcard DNS record for your domain?
  • Did you remember to create the acme.json file and set the correct permissions?
  • Run your docker compose file with docker-compose up (without the -d flag) and check the output logs for errors

Setup

1. Clone the repository to your server

  git clone https://github.com/tysker/3sem-traefik-setup-remote.git

2. Create a .env file and add your environment variables

# Lets-encrypt - Digital Ocean
PROVIDER=digitalocean
EMAIL=<your_email>
ACME_STORAGE=/etc/traefik/acme/acme.json
DO_AUTH_TOKEN=<your_digitalocean_token>

# Traefik
TRAFIK_DOMAIN=traefik.<your_domain>
DASHBOARD_AUTH=<your_dashboard_auth>

# API
API_DOMAIN=<your_api_domain>

# Postgres
POSTGRES_USER=<your_postgres_user>
POSTGRES_PASSWORD=<your_postgres_password>

# PgAdmin
PGADMIN_DOMAIN=pgadmin.<your_domain>
PGADMIN_DEFAULT_EMAIL=<your_pgadmin_email>
PGADMIN_DEFAULT_PASSWORD=<your_pgadmin_password>

# Watchtower
REPO_PASS=<your_dockerhub_token>
REPO_USER=<your_dockerhub_username>
  • To generate a digital ocean token, go to DigitalOcean and create a new token.

3. Create an acme directory and an acme.json file

  mkdir ./acme
  touch ./acme/acme.json
  chmod 600 ./acme
  chmod 600 ./acme/acme.json

4. How to generate a traefik dashboard login (only works in a linux terminal)

  echo $(htpasswd -nb <your_username> <your_password>) | sed -e s/\\$/\\$\\$/g

5. Run Docker

  docker-compose up -d

6. Stop Docker

  docker-compose down

7. Access Traefik Dashboard through browser

  traefik.<your_domain>

8. Access Your Rest Api

  <your_domain>/<your_api_path> (example: api.3sem.dk/api or restapi.3sem.dk/api)

Reset DB data installation

(-v) // remove volumes

 docker-compose down -v 
 sudo  rm -rf ./data
 sudo  rm -rf ./pgadmin-data

3 semester local environment setup

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.