-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FROM node:16.20.2-alpine AS builder | ||
RUN apk add --no-cache libc6-compat | ||
RUN npm i -g [email protected] | ||
|
||
# Create app directory | ||
WORKDIR /app | ||
|
||
# A wildcard is used to ensure both package.json AND package-lock.json are copied | ||
COPY package*.json ./ | ||
RUN pnpm install | ||
|
||
COPY . . | ||
RUN npm run build | ||
|
||
FROM node:16.20.2-alpine | ||
RUN apk add --no-cache libc6-compat | ||
RUN npm i -g [email protected] | ||
WORKDIR /app | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package*.json ./ | ||
COPY --from=builder /app/dist ./dist | ||
|
||
|
||
EXPOSE 4000 | ||
CMD [ "npm", "run", "start" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
var http = require('http'); | ||
|
||
|
||
|
||
async function bootstrap() { | ||
console.log('Hello'); | ||
console.log('Starting server...'); | ||
//create a server object: | ||
http | ||
.createServer(function (req, res) { | ||
res.write('Hello World!'); //write a response to the client | ||
res.end(); //end the response | ||
}) | ||
.listen(8080); //the server object listens on port 8080 | ||
} | ||
bootstrap(); |