Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
FROM node:bookworm-slim
ENV NODE_ENV=production
FROM node:20-slim

WORKDIR /app

COPY ["package.json", "./"]
RUN corepack enable

RUN npm install
COPY package.json pnpm-lock.yaml* ./

RUN pnpm install --frozen-lockfile

COPY . .

CMD [ "node", "index.js" ]
EXPOSE 8080

CMD ["pnpm", "start"]
13 changes: 13 additions & 0 deletions FROM node:20 WORKDIR /Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:20

WORKDIR /app

COPY package*.json ./
RUN npm install -g pnpm
RUN pnpm install

COPY . .

EXPOSE 8080

CMD ["pnpm", "start"]
10 changes: 4 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import basicAuth from "express-basic-auth";
import bareMuxNode from "@mercuryworkshop/bare-mux/node";
import { server as wisp } from "@mercuryworkshop/wisp-js/server";
import mime from "mime";
import fetch from "node-fetch";
const fetch = global.fetch;
// import { setupMasqr } from "./Masqr.js";
import config from "./config.js";

console.log(chalk.yellow("🚀 Starting server..."));

const __dirname = process.cwd();
const server = http.createServer();
const server = http.createServer((req, res) => app(req, res));
const app = express();
const bareServer = createBareServer("/ca/");
const { baremuxPath } = bareMuxNode;
Expand Down Expand Up @@ -160,8 +160,6 @@ server.on("upgrade", (req, socket, head) => {
}
});

server.on("listening", () => {
console.log(chalk.green(`🌍 Server is running on http://localhost:${PORT}`));
server.listen(PORT, "0.0.0.0", () => {
console.log(`🌍 Server running on port ${PORT}`);
});

server.listen({ port: PORT });