index : static-web-server.git

ascending towards madness

author Jose Quintana <1700322+joseluisq@users.noreply.github.com> 2021-07-08 11:29:41.0 +00:00:00
committer GitHub <noreply@github.com> 2021-07-08 11:29:41.0 +00:00:00
commit
8128b1771369c09020c42fe95b996189f4ffae6f [patch]
tree
b666a20df993c56855acde8dc6c6c568c2344143
parent
432b591277de8556b2708757eee4281f2310e041
parent
2aa130dd0bb126df615d167e9593f236a79f5eda
download
8128b1771369c09020c42fe95b996189f4ffae6f.tar.gz

Merge pull request #48 from joseluisq/feature/move_public_to_docker_dir

refactor: move `./public` to `./docker` directory

Diff

 docker/alpine/Dockerfile         |  2 +-
 docker/public/404.html           |  9 +++++++++
 docker/public/50x.html           |  9 +++++++++
 docker/public/assets/favicon.ico | Bin 0 -> 23229 bytes
 docker/public/assets/main.css    | 15 +++++++++++++++
 docker/public/assets/main.js     |  1 +
 docker/public/index.html         | 15 +++++++++++++++
 docker/scratch/Dockerfile        |  2 +-
 public/404.html                  |  9 ---------
 public/50x.html                  |  9 ---------
 public/assets/favicon.ico        | Bin 23229 -> 0 bytes
 public/assets/main.css           | 15 ---------------
 public/assets/main.js            |  1 -
 public/index.html                | 15 ---------------
 sample.env                       |  2 +-
 15 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/docker/alpine/Dockerfile b/docker/alpine/Dockerfile
index e88d407..e45084a 100644
--- a/docker/alpine/Dockerfile
+++ b/docker/alpine/Dockerfile
@@ -16,7 +16,7 @@ RUN set -ex; \
	chmod +x /usr/local/bin/static-web-server

COPY ./docker/alpine/entrypoint.sh /
COPY ./public /public
COPY ./docker/public /public

EXPOSE 80
VOLUME ["/public"]
diff --git a/docker/public/404.html b/docker/public/404.html
new file mode 100644
index 0000000..d339d77
--- /dev/null
+++ b/docker/public/404.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>404 Content was not found</title>
</head>
<body>
<center><h1>404 Content was not found</h1></center>
</body>
</html>
diff --git a/docker/public/50x.html b/docker/public/50x.html
new file mode 100644
index 0000000..9a20203
--- /dev/null
+++ b/docker/public/50x.html
@@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>50x Service Unavailable</title>
</head>
<body>
<center><h1>50x Service Unavailable</h1></center>
</body>
</html>
diff --git a/docker/public/assets/favicon.ico b/docker/public/assets/favicon.ico
new file mode 100644
index 0000000..b8ad237
Binary files /dev/null and b/docker/public/assets/favicon.ico differ
diff --git a/docker/public/assets/main.css b/docker/public/assets/main.css
new file mode 100644
index 0000000..cc34e89
--- /dev/null
+++ b/docker/public/assets/main.css
@@ -0,0 +1,15 @@
body {
  font-family: sans-serif;
  color: black;
  text-align: center;
  font-size: 1.2rem;
}

h1 a {
  text-decoration: none;
  color: black;
}

a {
  color: #0366d6;
}
diff --git a/docker/public/assets/main.js b/docker/public/assets/main.js
new file mode 100644
index 0000000..fecd9f2
--- /dev/null
+++ b/docker/public/assets/main.js
@@ -0,0 +1 @@
(() => console.log("Static Web Server running!"))()
diff --git a/docker/public/index.html b/docker/public/index.html
new file mode 100644
index 0000000..dd87f3e
--- /dev/null
+++ b/docker/public/index.html
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="en">
<html>
    <head>
    <title>Static Web Server</title>
    <link rel="stylesheet" href="/assets/main.css">
    <link rel="shortcut icon" href="/assets/favicon.ico">
</head>
<body>
    <h1>Static Web Server</h1>
    <p>A blazing fast static files-serving web server powered by Rust.</p>
    <p><a href="https://github.com/joseluisq/static-web-server/" target="_blank">View on GitHub</a></p>
    <script src="/assets/main.js"></script>
</body>
</html>
diff --git a/docker/scratch/Dockerfile b/docker/scratch/Dockerfile
index 0e9728f..758e965 100644
--- a/docker/scratch/Dockerfile
+++ b/docker/scratch/Dockerfile
@@ -12,7 +12,7 @@ LABEL version="${SERVER_VERSION}" \
    maintainer="Jose Quintana <joseluisq.net>"

COPY --from=latest /usr/local/bin/static-web-server /
COPY ./public /public
COPY ./docker/public /public

EXPOSE 80
VOLUME ["/public"]
diff --git a/public/404.html b/public/404.html
deleted file mode 100644
index d339d77..0000000
--- a/public/404.html
+++ /dev/null
@@ -1,9 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>404 Content was not found</title>
</head>
<body>
<center><h1>404 Content was not found</h1></center>
</body>
</html>
diff --git a/public/50x.html b/public/50x.html
deleted file mode 100644
index 9a20203..0000000
--- a/public/50x.html
+++ /dev/null
@@ -1,9 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>50x Service Unavailable</title>
</head>
<body>
<center><h1>50x Service Unavailable</h1></center>
</body>
</html>
diff --git a/public/assets/favicon.ico b/public/assets/favicon.ico
deleted file mode 100644
index b8ad237..0000000
Binary files a/public/assets/favicon.ico and /dev/null differ
diff --git a/public/assets/main.css b/public/assets/main.css
deleted file mode 100644
index cc34e89..0000000
--- a/public/assets/main.css
+++ /dev/null
@@ -1,15 +0,0 @@
body {
  font-family: sans-serif;
  color: black;
  text-align: center;
  font-size: 1.2rem;
}

h1 a {
  text-decoration: none;
  color: black;
}

a {
  color: #0366d6;
}
diff --git a/public/assets/main.js b/public/assets/main.js
deleted file mode 100644
index fecd9f2..0000000
--- a/public/assets/main.js
+++ /dev/null
@@ -1 +0,0 @@
(() => console.log("Static Web Server running!"))()
diff --git a/public/index.html b/public/index.html
deleted file mode 100644
index dd87f3e..0000000
--- a/public/index.html
+++ /dev/null
@@ -1,15 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<html>
    <head>
    <title>Static Web Server</title>
    <link rel="stylesheet" href="/assets/main.css">
    <link rel="shortcut icon" href="/assets/favicon.ico">
</head>
<body>
    <h1>Static Web Server</h1>
    <p>A blazing fast static files-serving web server powered by Rust.</p>
    <p><a href="https://github.com/joseluisq/static-web-server/" target="_blank">View on GitHub</a></p>
    <script src="/assets/main.js"></script>
</body>
</html>
diff --git a/sample.env b/sample.env
index 8b9a409..b5e3be0 100644
--- a/sample.env
+++ b/sample.env
@@ -3,7 +3,7 @@ E_ARGS = "--port=8787"

# Server configuration
SERVER_LOG_LEVEL = "trace"
SERVER_ROOT = "public"
SERVER_ROOT = "docker/public"
# SERVER_PORT = 8787
SERVER_COMPRESSION = true
SERVER_DIRECTORY_LISTING = true