- Install Docker Desktop
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml file. We recommend you use one of the current tags instead of latest.
Because we already have an official CockroachDB docker image, we will use that in our docker-compose.yml file. We recommend you use one of the current tags instead of latest.
| const https = require('https') | |
| const { parse } = require('url') | |
| const next = require('next') | |
| const fs = require('fs') | |
| const dev = process.env.NODE_ENV !== 'production' | |
| const app = next({ dev }) | |
| const handle = app.getRequestHandler() | |
| const options = { |
| import * as Sentry from '@sentry/browser'; | |
| import getConfig from 'next/config'; | |
| import React from 'react'; | |
| const { SENTRY_DSN } = getConfig().publicRuntimeConfig; | |
| Sentry.init({ dsn: SENTRY_DSN }); | |
| /** | |
| * Send an error event to Sentry. |
| const withLess = require('@zeit/next-less') | |
| const withTypescript = require('@zeit/next-typescript') | |
| const resolve = require('resolve') | |
| module.exports = withTypescript(withLess({ | |
| lessLoaderOptions: { | |
| javascriptEnabled: true, | |
| // theme antd here | |
| modifyVars: {'@primary-color': '#1Dd57A'} |
| # First, install all of the things | |
| sudo su | |
| apt-get update | |
| apt-get install nginx | |
| /etc/init.d/nginx start | |
| apt-get install python-dev | |
| apt-get install python-pip | |
| apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs | |
| ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib |
Feel free to contact me at [email protected] or tweet at me @statisticsftw
This is a rough outline of how we utilize next.js and S3/Cloudfront. Hope it helps!
It assumes some knowledge of AWS.
| import javax.inject.{Inject, Singleton} | |
| import akka.stream.Materializer | |
| import play.api.Configuration | |
| import play.filters.cors.CORSConfig.Origins.Matching | |
| import play.filters.cors.{CORSConfig, CORSFilter} | |
| import scala.concurrent.ExecutionContext | |
| import scala.util.matching.Regex |
| { | |
| "name": "this-web-scale", | |
| "version": "0.0.1", | |
| "scripts": { | |
| "dev": "node server.js", | |
| "build": "NODE_ENV=production next build", | |
| "start": "NODE_ENV=production node server.js", | |
| "dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker", | |
| "deploy": "eb use this-web-scale-production && eb deploy --label v$npm_package_version --verbose", | |
| "build:docker": "docker build -t $npm_package_config_docker_image:$npm_package_version -t $npm_package_config_docker_image:latest .", |
| /** | |
| * Making promises | |
| */ | |
| let okPromise = Js.Promise.make((~resolve, ~reject as _) => [@bs] resolve("ok")); | |
| /* Simpler promise creation for static values */ | |
| Js.Promise.resolve("easy"); | |
| Js.Promise.reject(Invalid_argument("too easy")); |