add server docker file

This commit is contained in:
nannal 2020-12-30 17:48:33 +02:00
parent 1decbb8e91
commit c14a4726ba
4 changed files with 40 additions and 14 deletions

View File

@ -10,7 +10,10 @@ http {
server { server {
location /submit { location /submit {
proxy_pass http://tradegame/submit; proxy_pass http://tradegame:5000/submit;
}
location /status {
proxy_pass http://tradegame:5000/status;
} }
location / { location / {
root /usr/share/nginx/html; root /usr/share/nginx/html;

View File

@ -1,18 +1,34 @@
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>🚂Vote Train🚂</title> <title>oh ne!</title>
<link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet"> <link href="https://unpkg.com/tailwindcss@^2/dist/tailwind.min.css" rel="stylesheet">
<script type="text/javascript" src="script.js"></script> <script type="text/javascript" src="script.js"></script>
</head> </head>
<body class=""> <body class="">
<div class="justify-center text-center text-white sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl"> <div class="text-center justify-center text-black sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl ">
<div id="input" class="py-10 sm:max-w-xl mx-auto font-mono"> Info <br>
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-r-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest"> <div id="price">Price: 0</div>
<input type="text" placeholder="key" class="text-black" id="key"/><br> <div id="ask">Ask: 0</div>
Upvote: <input type="checkbox" id="upvote"/><br> <div id="bid">Bid: 0</div>
Downvote: <input type="checkbox" id="downvote"/><br> </div>
<button onclick="send()" class="bg-gray-600 ">Submit</button> <div class="text-center justify-center text-white sm:text-lg bg-green-200 sm:p-20 h-full m-36 sm:rounded-3xl flex">
<div id="u1" class="p-1 font-mono">
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-l-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest w-96">
Agne <br>
<div id="AgneUSD">USD: 0</div>
<div id="AgneBTC">BTC: 0</div>
<div id="AgneMessage"></div>
<button onclick="send('Agne','USD')" class="bg-gray-600 ">USD</button> <button onclick="send('Agne','BTC')" class="bg-gray-600">BTC</button>
</form>
</div>
<div id="u1" class="p-1 font-mono">
<form action="javascript:void(0)" class="shadow-2xl sm:rounded-r-full sm:p-10 bg-gradient-to-t from-black to-gray-500 tracking-widest w-96">
Dan <br>
<div id="DanUSD">USD: 0</div>
<div id="DanBTC">BTC: 0</div>
<div id="DanMessage"></div>
<button onclick="send('Dan','USD')" class="bg-gray-600 ">USD</button> <button onclick="send('Dan','BTC')" class="bg-gray-600">BTC</button>
</form> </form>
</div> </div>
</div> </div>

View File

@ -1,9 +1,7 @@
async function send(){ async function send(userID, asset){
data={ data={
key:document.getElementById("key").value, userID: userID,
upvote: document.getElementById("upvote").checked, asset: asset
downvote:document.getElementById("downvote").checked,
} }
let response = await fetch('/submit', { let response = await fetch('/submit', {
method: 'POST', method: 'POST',

9
server/Dockerfile Normal file
View File

@ -0,0 +1,9 @@
FROM node:latest
ADD ./ /app
WORKDIR /app
RUN npm i
CMD ["node /app/index.js"]