Skip to content

Instantly share code, notes, and snippets.

@tmartin2089
Last active June 6, 2019 23:28
Show Gist options
  • Save tmartin2089/0846ee0146df7ec848da9ee794a6a24e to your computer and use it in GitHub Desktop.
Save tmartin2089/0846ee0146df7ec848da9ee794a6a24e to your computer and use it in GitHub Desktop.
simple app not working in docker
FROM node:8
# install version of chromium puppeteer needs for docker container
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# skip puppeteer chromium DL
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
# bamboo stuff
RUN npm install -g --no-progress npm-cache
<!DOCTYPE html>
<html lang="en">
<body>
<div id="root"></div>
</body>
</html>
/* eslint-disable */
import {
h,
render,
Component
} from 'preact';
const rootElem = document.getElementById('root');
class App extends Component {
constructor(props) {
super(props);
}
render() {
return (
<div id="app">
<h1>hi how are you</h1>
</div>
);
}
}
function init() {
if (rootElem.hasChildNodes()) {
render(<App />, rootElem, rootElem.firstElementChild);
} else {
render(<App />, rootElem);
}
}
// development
if (module.hot) {
// require('preact/devtools');
module.hot.accept(<App />, () => requestAnimationFrame(init));
}
init();
{
"name": "peregrine-preact",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "cross-env NODE_ENV=production webpack -p ---env.env=production",
"build:bundleanalyzer": "yarn build --env.addons=bundleanalyzer",
"dev": "cross-env NODE_ENV=development webpack-dev-server --inline --progress --env.env=develop",
"lint-js": "eslint --ext .js src/",
"dev:bundleanalyzer": "yarn dev --env.addons=bundleanalyzer",
"prebuild": "rimraf dist",
"postbuild": "react-snap"
},
"author": "",
"license": "ISC",
"dependencies": {
"@babel/core": "^7.3.4",
"@babel/plugin-proposal-class-properties": "^7.3.4",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.3.4",
"@babel/preset-react": "^7.0.0",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.5",
"babel-plugin-react-css-modules": "^5.2.4",
"babel-plugin-transform-react-jsx": "^6.24.1",
"core-js": "^3.0.1",
"css-loader": "^2.1.1",
"dayjs": "^1.8.13",
"dotenv": "^6.2.0",
"es6-promise-promise": "^1.0.0",
"eslint": "^5.16.0",
"eslint-config-developit": "^1.1.1",
"eslint-loader": "^2.1.2",
"file-loader": "^3.0.1",
"glob": "^7.1.3",
"html-webpack-plugin": "^3.2.0",
"imagemin-gifsicle": "^6.0.1",
"imagemin-jpegtran": "^6.0.0",
"imagemin-optipng": "^6.0.0",
"imagemin-svgo": "^7.0.0",
"imagemin-webpack": "^4.1.0",
"lodash.get": "^4.4.2",
"lodash.sortby": "^4.7.0",
"node-sass": "^4.11.0",
"node-sass-importer": "^1.0.0",
"node-sass-package-importer": "^5.3.1",
"optimize-css-assets-webpack-plugin": "4.0.0",
"path": "^0.12.7",
"postcss-import": "^12.0.1",
"postcss-url": "^8.0.0",
"preact": "^8.1.0",
"preact-compat": "^3.18.5",
"preact-helmet": "^4.0.0-alpha-3",
"preact-router": "^2.6.1",
"purgecss-webpack-plugin": "^1.4.0",
"react-router-dom": "^5.0.0",
"react-snap": "^1.23.0",
"resolve-url-loader": "2.3.2",
"rimraf": "^2.6.3",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"url-loader": "^1.1.2",
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3",
"webpack-dev-server": "^3.2.1",
"webpack-merge": "^4.2.1",
"whatwg-fetch": "^3.0.0"
},
"devDependencies": {
"autoprefixer": "^9.4.10",
"babel-preset-env": "^1.7.0",
"babel-preset-preact": "^1.1.0",
"babel-preset-stage-3": "^6.24.1",
"cross-env": "^5.2.0",
"cssnano": "^4.1.10",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"mini-css-extract-plugin": "^0.6.0",
"postcss-loader": "^3.0.0",
"postcss-preset-env": "^6.6.0",
"webpack-bundle-analyzer": "^3.3.2"
},
"reactSnap": {
"source": "dist",
"inlineCss": true,
"skipThirdPartyRequests": true,
"puppeteerArgs": [
"--no-sandbox",
"--disable-setuid-sandbox"
],
"puppeteerExecutablePath": "google-chrome-unstable"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment