Skip to content

Instantly share code, notes, and snippets.

@sync
Last active March 22, 2019 01:45
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 sync/f606de74515bf639c53c46d38904e16f to your computer and use it in GitHub Desktop.
Save sync/f606de74515bf639c53c46d38904e16f to your computer and use it in GitHub Desktop.
Example docker
[@bs.config {jsx: 3}];
type route =
| Home
| More;
let mapPathToRoute = (path: list(string)) =>
switch (path) {
| [] => Home
| ["more"] => More
| _ => Home
};
[@react.component]
let make = () => {
let url = ReasonReactRouter.useUrl();
<div>
<main>
{switch (url.path |> mapPathToRoute) {
| Home => <Home />
| More => <More />
}}
</main>
</div>;
};
{
"name": "pennyworth",
"bsc-flags": ["-bs-no-version-header", "-bs-super-errors"],
"ppx-flags": ["./node_modules/.bin/reactjs_jsx_ppx_v3.exe"],
"namespace": true,
"bs-dependencies": ["reason-react"],
"sources": [
{
"dir": "app",
"subdirs": true
},
{
"dir": "server",
"subdirs": true
}
],
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".bs.js",
"refmt": 3
}
FROM node:8
RUN apt-get update && apt-get install -y wget --no-install-recommends \
&& 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 -y install procps \
&& apt-get -y install util-linux \
&& apt-get -y install curl \
&& apt-get -y install build-essential \
&& apt-get -y install git \
&& apt-get install -y google-chrome-unstable \
--no-install-recommends
RUN npm install -g yarn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment