xbrowsersync / api

Server-side REST API that serves requests from xBrowserSync client apps
GNU General Public License v3.0
796 stars 83 forks source link

Docker install please #15

Closed gerroon closed 5 years ago

gerroon commented 6 years ago

Hi

It would be nice if you offer Docker install, I think if you want large numbers of adaptations the installation should be a bit easier.

thanks

nero120 commented 6 years ago

Good idea, thanks for the suggestion @gerroon.

cybermcm commented 6 years ago

I'd love a Docker install, would start right away with it!

mng-au commented 6 years ago

If you guys don't mind my shameless plug 😏. I uploaded my docker-compose setup to https://github.com/mng-au/docker-xBrowserSync-api. Hope this will help someone 👍.

nero120 commented 6 years ago

Nice work @mng-au!

I have prepared a dockerfile to provision just the api as a container and a docker compose file that will provision a production-ready api with db, web server and ssh certs. I'll be releasing them shortly and my plan is to move api.xbrowsersync.org into a containerised environment using the same docker compose file.

Hopefully then, anyone who wants to stand up a fully configured, production ready xBrowserSync service can do so with zero config. I'll respond here once it's ready to go.

NachoParra commented 6 years ago

Hi,

I also have created my own docker image that you can compile by yourself in which you will have the mongodb initialized & started so you can hear on the port 28080:

docker-xBrowserSync-api

Here you can also get the basic settings file and the commands to compile & run the image.

If you need to run this behind a nginx as reverse proxy, please add the following lines on the nginx confi file

location /xbrowsersync/ {
    auth_basic off;
    rewrite ^/xbrowsersync(/.*)$ $1 break;
    proxy_pass  http://192.168.1.175:28080/;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_redirect    off;
}
mng-au commented 6 years ago

Nice work @mng-au!

I have prepared a dockerfile to provision just the api as a container and a docker compose file that will provision a production-ready api with db, web server and ssh certs. I'll be releasing them shortly and my plan is to move api.xbrowsersync.org into a containerised environment using the same docker compose file.

Hopefully then, anyone who wants to stand up a fully configured, production ready xBrowserSync service can do so with zero config. I'll respond here once it's ready to go.

I think a reverse proxy like Traefik will simplify SSL support. I will update my repo to include traefik for demo when possible.

nero120 commented 5 years ago

I think a reverse proxy like Traefik will simplify SSL support. I will update my repo to include traefik for demo when possible.

@mng-au I've been testing Traefik and it's great! Thanks for the suggestion, it's much cleaner than configuring an nginx container with certbot! I'll release my docker files shortly as I think they're ready for distribution now.

mng-au commented 5 years ago

I think a reverse proxy like Traefik will simplify SSL support. I will update my repo to include traefik for demo when possible.

@mng-au I've been testing Traefik and it's great! Thanks for the suggestion, it's much cleaner than configuring an nginx container with certbot! I'll release my docker files shortly as I think they're ready for distribution now.

Good to know it's helping you. My bad, I thought I will have the time to update the sample 😂 but it has been 2 weeks already... OMG 😂 I will try the docker files when available 👍

holazt commented 5 years ago

@nero120 Already one week. :joy:

nero120 commented 5 years ago

Apologies for the long wait (new babies and sick wives have to come before FOSS projects!) but I've managed to finish the Docker configuration for running an xBrowserSync API. You can grab the image on hub.docker.com here:

https://hub.docker.com/r/xbrowsersync/api

I've also included in the api-docker GitHub repo the required docker-compose files for orchestrating a complete production-ready SSL-secured xBrowserSync service, including a fully configured MongoDB database container and a traefik reverse proxy.

Do let me know if you find any immediate issues, otherwise you can log anything you find in future in the Issues list in the api-docker GitHub repo.

Have fun and Merry Christmas! 🎄

holazt commented 5 years ago

@nero120 Thanks, that's wonderful! Merry Christmas! :christmas_tree: