Skip to content

Instantly share code, notes, and snippets.

@gabonator
Last active March 18, 2023 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabonator/acedeefd78a75fff2db04cf6314df19d to your computer and use it in GitHub Desktop.
Save gabonator/acedeefd78a75fff2db04cf6314df19d to your computer and use it in GitHub Desktop.
npm install express
podman build -t pokusimage .
FROM node:10-alpine
RUN mkdir -p /src/app
WORKDIR /src/app
COPY package.json /src/app/package.json
RUN npm install
COPY . /src/app
EXPOSE 3000
CMD [ "npm", "start" ]
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => res.send('Hello World! ' + new Date()))
app.listen(port, () => console.log(`My server listening at http://localhost:${port}`))
{
"name": "pokus",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node index.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"express": "^4.18.2"
}
}
# https://osric.com/chris/accidental-developer/2018/12/docker-versus-podman-and-iptables/
# iptables -I CNI-FORWARD -p tcp ! -i cni-podman0 -o cni-podman0 -d 10.88.0.0/24 --dport 3000 -j ACCEPT
podman run -p 3000:3000 pokusimage:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment