This page show you how to run a Mojolicious app on Scaleway in a Docker container.
- You have an account and are logged into cloud.scaleway.com
First you need create and start a new C1 server using the Docker Image.
ssh root@< your scaleway server ip >
git clone https://github.com/loorko/MojoWebAppScaleway
cd MojoWebAppScaleway
docker build -t mojo-web-app .
docker run -p 8080 -t -i --name mojo_web_app mojo-web-app
docker inspect --format '{{ .NetworkSettings.IPAddress }}' mojo_web_app
Probably you get:
172.17.0.2
curl 172.17.0.2:8080
You get an HTML answer, somhting like this:
<!DOCTYPE html>
<html>
<head><title>Welcome</title></head>
<body><h1>Mojolicious</h1>
</body>
</html>
apt-get install nginx
unlink /etc/nginx/sites-enabled/default
cp .overlay/etc/nginx/sites-available/application /etc/nginx/sites-available/
ln -s /etc/nginx/sites-available/application /etc/nginx/sites-enabled/
nginx -s reload
Go to < your scaleway server ip >, and enjoy it.
unlink /etc/nginx/sites-enabled/application
ln -s /etc/nginx/sites-available/default /etc/nginx/sites-enabled/
nginx -s reload