Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computer_science:docker:traefik_docker_https_ssl_for_containers [2020/08/19 09:35] – carlossousa | computer_science:docker:traefik_docker_https_ssl_for_containers [2023/12/01 12:07] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Using " | ====== Using " | ||
- | ===== | + | ===== Important Note : ===== |
This is an alternative method to [[: | This is an alternative method to [[: | ||
Line 15: | Line 15: | ||
===== Create the Folder and Config Files ===== | ===== Create the Folder and Config Files ===== | ||
- | Change the Path under " | + | * Change the Path under " |
<code bash> | <code bash> | ||
Line 24: | Line 24: | ||
chmod 600 " | chmod 600 " | ||
touch " | touch " | ||
- | docker volume create --driver local --opt type=none --opt device=" | + | |
</ | </ | ||
Line 30: | Line 30: | ||
===== Deploy the Traefik configuration ===== | ===== Deploy the Traefik configuration ===== | ||
- | Change " | + | * Change " |
<code bash> | <code bash> | ||
nano traefik.yml | nano traefik.yml | ||
+ | |||
</ | </ | ||
Line 59: | Line 60: | ||
httpChallenge: | httpChallenge: | ||
entryPoint: http | entryPoint: http | ||
+ | |||
</ | </ | ||
+ | |||
===== Create the traefik docker-compose.yml ===== | ===== Create the traefik docker-compose.yml ===== | ||
* Change the " | * Change the " | ||
- | * Create a USER: | + | * Create a USER: |
- | * | + | |
<code bash> | <code bash> | ||
echo $(htpasswd -nb < | echo $(htpasswd -nb < | ||
+ | |||
</ | </ | ||
- | * | ||
<code bash> | <code bash> | ||
Line 90: | Line 93: | ||
- / | - / | ||
- / | - / | ||
- | - traefik_data/ | + | - ./ |
- | - traefik_data/ | + | - ./ |
labels: | labels: | ||
- " | - " | ||
Line 109: | Line 112: | ||
proxy: | proxy: | ||
external: true | external: true | ||
+ | " | ||
+ | - " | ||
+ | - " | ||
- | volumes: | + | networks: |
- | | + | |
external: true | external: true | ||
+ | |||
</ | </ | ||
Line 118: | Line 125: | ||
===== Adding Services to Traefik ===== | ===== Adding Services to Traefik ===== | ||
- | Start the traefik container - docker-compose up -d | + | Start the traefik container - docker-compose up -d |
Change your docker-compose.yml from other services to be available via Traefik. | Change your docker-compose.yml from other services to be available via Traefik. | ||
Line 125: | Line 132: | ||
**Before** | **Before** | ||
+ | |||
+ | <code yaml> | ||
+ | version: ' | ||
+ | |||
+ | volumes: | ||
+ | dokuwiki_data: | ||
+ | external: true | ||
+ | dokuwiki_conf: | ||
+ | external: true | ||
+ | dokuwiki_lib-plugins: | ||
+ | external: true | ||
+ | dokuwiki_lib-tpl: | ||
+ | external: true | ||
+ | dokuwiki_logs: | ||
+ | external: true | ||
+ | |||
+ | services: | ||
+ | dokuwiki: | ||
+ | image: ' | ||
+ | container_name: | ||
+ | ports: | ||
+ | - ' | ||
+ | volumes: | ||
+ | - dokuwiki_data:/ | ||
+ | - dokuwiki_conf:/ | ||
+ | - dokuwiki_lib-plugins:/ | ||
+ | - dokuwiki_lib-tpl:/ | ||
+ | - dokuwiki_logs:/ | ||
+ | |||
+ | |||
+ | </ | ||
**After** | **After** | ||
+ | |||
+ | * You can uncomment the " | ||
+ | * Add the " | ||
+ | * Don't forget to change the " | ||
+ | * Don't forget to change the " | ||
+ | * For complex services (for example Wordpress + MySQL), add an extra network, for eg. " | ||
+ | |||
+ | <code yaml> | ||
+ | version: ' | ||
+ | |||
+ | volumes: | ||
+ | dokuwiki_data: | ||
+ | external: true | ||
+ | dokuwiki_conf: | ||
+ | external: true | ||
+ | dokuwiki_lib-plugins: | ||
+ | external: true | ||
+ | dokuwiki_lib-tpl: | ||
+ | external: true | ||
+ | dokuwiki_logs: | ||
+ | external: true | ||
+ | |||
+ | services: | ||
+ | dokuwiki: | ||
+ | image: ' | ||
+ | container_name: | ||
+ | restart: unless-stopped | ||
+ | networks: | ||
+ | - proxy | ||
+ | #ports: | ||
+ | # - ' | ||
+ | volumes: | ||
+ | - dokuwiki_data:/ | ||
+ | - dokuwiki_conf:/ | ||
+ | - dokuwiki_lib-plugins:/ | ||
+ | - dokuwiki_lib-tpl:/ | ||
+ | - dokuwiki_logs:/ | ||
+ | labels: | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | - " | ||
+ | |||
+ | networks: | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | </ | ||
+ | |||
+ | After starting the service, it should now be available. | ||