hardcode post, dockerising

This commit is contained in:
Anuj K 2025-09-03 23:24:59 +05:30
parent e0563ba5e4
commit c09c97df27
4 changed files with 27 additions and 2 deletions

12
.dockerignore Normal file
View file

@ -0,0 +1,12 @@
# Ignore dependencies, we install them in the container
node_modules
# Ignore local environment files
.env
# Ignore Docker related files
Dockerfile
.dockerignore
# Ignore logs
npm-debug.log

View file

@ -1,3 +1,2 @@
PORT=3000
RA_USER=your_retroachievements_username RA_USER=your_retroachievements_username
RA_KEY=your_retroachievements_api_key RA_KEY=your_retroachievements_api_key

14
Dockerfile Normal file
View file

@ -0,0 +1,14 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY backend/ ./backend/
COPY public/ ./public/
EXPOSE 8090
CMD ["node", "backend/server.js"]

View file

@ -7,7 +7,7 @@ const path = require('path');
// Create Express app and HTTP server // Create Express app and HTTP server
const app = express(); const app = express();
const server = http.createServer(app); const server = http.createServer(app);
const PORT = process.env.PORT || 3000; const PORT = 8090;
// Middleware to parse JSON requests // Middleware to parse JSON requests
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: true })); app.use(express.urlencoded({ extended: true }));