alias docker-build='function \_docker_deploy() { \
image_name=$(basename "$PWD"); \
short_hash=$(git rev-parse --short HEAD); \
full_tag="registry.digitalocean.com/shootingsupplies/${image_name}:${short_hash}"; \
docker compose build --no-cache; \
docker tag "${image_name}" "$full_tag"; \
docker push "$full_tag"; \
This file contains hidden or 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
User-agent: * | |
# Next.JS Crawl Budget Performance Updates | |
# Block files ending in .json, _buildManifest.js, _middlewareManifest.js, _ssgManifest.js, and any other JS files | |
Disallow: /*.json$ | |
Disallow: /*_buildManifest.js$ | |
Disallow: /*_middlewareManifest.js$ | |
Disallow: /*_ssgManifest.js$ | |
Disallow: /*.js$ | |
Disallow: /api/ | |
Disallow: /_next/ |
import { PrismaClient } from '@prisma/client'
const prismaClientSingleton = () => { return new PrismaClient() }
declare const globalThis: { prismaGlobal: ReturnType; } & typeof global;
This file contains hidden or 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
# Generat Openssl key and cert. | |
openssl req -x509 -newkey rsa:4096 -nodes -keyout key.pem -out cert.pem -days 365 |
docker history --human --format "{{.CreatedBy}}: {{.Size}}" docker-image
This file contains hidden or 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
// Create a form synamically | |
var form = document.createElement("form"); | |
form.setAttribute("method", "post"); | |
form.setAttribute("action", "submit.php"); | |
// Create an input element for Full Name | |
var FN = document.createElement("input"); | |
FN.setAttribute("type", "text"); | |
FN.setAttribute("name", "FullName"); | |
FN.setAttribute("placeholder", "Full Name"); |
This file contains hidden or 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
"traefik.enable=true" | |
"traefik.docker.network=proxy" | |
"traefik.http.routers.app-secure.entrypoints=websecure" | |
"traefik.http.routers.app-secure.rule=Host(`domain.name`)" |
This file contains hidden or 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
Dockerfile changes: | |
# Install dependencies only when needed | |
FROM node:14-alpine AS deps | |
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json yarn.lock ./ | |
**COPY ./prisma/schema.prisma ./prisma/schema.prisma** | |
RUN yarn install --frozen-lockfile |
This file contains hidden or 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
axios.interceptors.response.use(function(response) { | |
return response; | |
}, async function(error) { | |
await new Promise(function(res) { | |
setTimeout(function() {res()}, 10000); | |
}); | |
const originalRequest = error.config; | |
if (error.response.status===401 && !originalRequest._retry) { |
NewerOlder