Skip to content

Commit 2d9c273

Browse files
author
Keith Halsall
committed
Merge branch 'summit-workshop' of github.com:apollosolutions/graphos-workshop into summit-workshop
2 parents ab7032c + 3e89e79 commit 2d9c273

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

website/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM node:18-alpine
2+
3+
WORKDIR /app
4+
5+
COPY package.json .
6+
7+
RUN npm install
8+
RUN npm run build
9+
10+
COPY . .
11+
12+
EXPOSE 4000
13+
14+
CMD ["node", "app.js"]

website/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
},
2525
"scripts": {
2626
"start": "DISABLE_ESLINT_PLUGIN=true react-scripts start",
27-
"build": "react-scripts build",
27+
"build": "DISABLE_ESLINT_PLUGIN=true react-scripts build",
2828
"test": "react-scripts test",
2929
"eject": "react-scripts eject"
3030
},

website/server.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const express = require('express');
2+
const path = require('path');
3+
4+
const app = express();
5+
const port = process.env.PORT || 4000;
6+
7+
// Serve static files from the build folder
8+
app.use(express.static(path.join(__dirname, 'build')));
9+
10+
// Handle requests to the root URL
11+
app.get('/', (req, res) => {
12+
res.sendFile(path.join(__dirname, 'build', 'index.html'));
13+
});
14+
15+
// Start the server
16+
app.listen(port, () => {
17+
console.log(`Server is running on port ${port}`);
18+
});

0 commit comments

Comments
 (0)