Skip to content

Instantly share code, notes, and snippets.

@pixelatedpic
Last active April 28, 2025 18:55
Show Gist options
  • Save pixelatedpic/cc6d7a98bd32cb930089ddb3ff4f10b3 to your computer and use it in GitHub Desktop.
Save pixelatedpic/cc6d7a98bd32cb930089ddb3ff4f10b3 to your computer and use it in GitHub Desktop.
FROM nginx:alpine
RUN mkdir -p /app/data
COPY shared_data/vessel_info.html /app/data/index.html
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
docker build --no-cache -t vessel-web .
docker run -d --name vessel-container -p 8080:80 -v ./shared_data:/app/data vessel-web
#to remover
docker rm -f container name
nginx.conf
---------
events {}
http {
server {
listen 80;
location / {
root /app/data;
index vessel_info.html;
}
}
}
=============================
docker exec -it vessel-container sh
# Check shared volume
ls /app/data
============================
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vessel Information</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #e6f2ff;
margin: 0;
padding: 20px;
}
h1 {
color: #005580;
}
table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}
table, th, td {
border: 1px solid #005580;
}
th, td {
padding: 12px;
text-align: left;
}
th {
background-color: #cce6ff;
}
</style>
</head>
<body>
<h1>Vessel Information</h1>
<table>
<tr>
<th>Vessel Name</th>
<th>IMO Number</th>
<th>Flag</th>
<th>Type</th>
<th>Year Built</th>
</tr>
<tr>
<td>Ocean Explorer</td>
<td>9876543</td>
<td>Panama</td>
<td>Cargo Ship</td>
<td>2010</td>
</tr>
<tr>
<td>Sea Spirit</td>
<td>8765432</td>
<td>Bahamas</td>
<td>Passenger Ship</td>
<td>2015</td>
</tr>
<tr>
<td>Wave Runner</td>
<td>7654321</td>
<td>Norway</td>
<td>Fishing Vessel</td>
<td>2005</td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment