summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimponic <loganhunt@simponic.xyz>2022-06-04 16:01:10 -0600
committerSimponic <loganhunt@simponic.xyz>2022-06-04 16:01:10 -0600
commitf6871ced2774a88f5177421224e7ae2375404e61 (patch)
treea09c7eccb9ed8636a23cf8a7561658762d068908
parent07a2c18985284431c18a619cfaa3f5681239dd48 (diff)
downloadbbiy-prod.tar.gz
bbiy-prod.zip
Add prod branch for launching on simponic.xyzprod
-rw-r--r--.dockerignore1
-rw-r--r--Dockerfile8
-rw-r--r--docker-compose.yml9
-rw-r--r--src/bootstrap.js2
-rw-r--r--src/game.js2
-rw-r--r--styles/style.css4
6 files changed, 22 insertions, 4 deletions
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+node_modules
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..fb0b504
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,8 @@
+FROM node:18.2.0
+ENV NODE_ENV=production
+
+WORKDIR /app
+COPY ["package.json", "package-lock.json*", "./"]
+RUN npm install
+COPY . .
+CMD [ "node", "index.js" ]
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..9f3f97b
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,9 @@
+version: '3'
+
+services:
+ prod:
+ build: ./
+ ports:
+ - "3000:3000"
+ expose:
+ - 3000
diff --git a/src/bootstrap.js b/src/bootstrap.js
index 09e7ec5..b1e4d23 100644
--- a/src/bootstrap.js
+++ b/src/bootstrap.js
@@ -106,7 +106,7 @@ game.bootstrap = (() => {
const loadLevels = function() {
game.levels = [];
- fetch('/levels')
+ fetch('levels')
.then((r) => r.json())
.then((r) => game.levels = r);
}
diff --git a/src/game.js b/src/game.js
index 5a7e391..c9fe724 100644
--- a/src/game.js
+++ b/src/game.js
@@ -31,7 +31,7 @@ game.startLoop = () => {
game.lastTimeStamp = performance.now();
game.assets.music.play();
if (game.assets.music.paused) {
- alert("Failed to start background music; please allow autoplay in your browser settings.");
+ alert("Failed to start background music; please allow autoplay in your browser settings and refresh.");
}
requestAnimationFrame(game.loop);
};
diff --git a/styles/style.css b/styles/style.css
index 9f0dc5c..6e5ec46 100644
--- a/styles/style.css
+++ b/styles/style.css
@@ -1,7 +1,7 @@
body {
margin: 0;
font-family: Lucida Sans Typewriter,Lucida Console,monaco,Bitstream Vera Sans Mono,monospace;
- background-image: url("/assets/image/background.gif");
+ background-image: url("/bbiy/assets/image/background.gif");
background-size: cover;
image-rendering: pixelated;
}
@@ -70,4 +70,4 @@ body {
.menu-button:hover {
background-color: #d0d0d0;
-} \ No newline at end of file
+}