hardcode post, dockerising
This commit is contained in:
parent
e0563ba5e4
commit
c09c97df27
12
.dockerignore
Normal file
12
.dockerignore
Normal 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
|
|
@ -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
14
Dockerfile
Normal 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"]
|
|
@ -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 }));
|
||||||
|
|
Loading…
Reference in a new issue