This file contains 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
FROM node:18-alpine AS base | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
FROM base AS dev | |
RUN npm ci | |
COPY . ./ | |
RUN npm run build | |
FROM base AS prod |
This file contains 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
FROM node:18-alpine AS build | |
WORKDIR /app | |
COPY package.json package-lock.json ./ | |
RUN npm ci | |
COPY . ./ | |
RUN npm run build | |
RUN find ./dist -type f | xargs gzip -k | |
FROM nginx:1-alpine | |
COPY nginx.conf /etc/nginx/conf.d/default.conf |
This file contains 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
server { | |
gzip off; | |
gzip_static on; | |
location / { | |
root /usr/share/nginx/html; | |
try_files $uri $uri/ /index.html; | |
} | |
} |
This file contains 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
version: "3" | |
services: | |
watchtower: | |
image: containrrr/watchtower | |
restart: unless-stopped | |
volumes: | |
- /var/run/docker.sock:/var/run/docker.sock | |
- /root/.docker/config.json:/config.json | |
command: --cleanup --interval 60 | |
swag: |
This file contains 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
services: | |
mongo1: | |
image: mongo | |
ports: | |
- 127.0.0.1:27017:27017 | |
volumes: | |
- ./mongo1:/data/db | |
command: mongod --replSet replicaSet1 | |
mongo2: | |
image: mongo |
This file contains 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
const shallowEqual = (value1, value2) => { | |
if (Object.is(value1, value2)) { | |
return true; | |
} | |
const keys1 = Object.keys(value1); | |
const keys2 = Object.keys(value2); | |
if (Object.is(keys1.length, keys2.length)) { | |
return false; | |
} |
This file contains 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
server { | |
listen 443; | |
server_name example.com; | |
location / { | |
proxy_pass http://frontend; | |
} | |
location /api { | |
rewrite /api/(.*) /$1 break; | |
proxy_pass http://backend; | |
proxy_set_header Host $host; |
This file contains 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
name: Build Docker Image | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
build_api: | |
runs-on: ubuntu-latest | |
steps: |
This file contains 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
const name = 'RSA-OAEP'; | |
const hash = 'SHA-256'; | |
const modulusLength = 2048; | |
const publicExponent = new Uint8Array([1, 0, 1]); | |
const format = 'spki'; | |
const message = 'hello'; | |
// browser | |
const { privateKey, publicKey } = await crypto.subtle.generateKey( | |
{ name, hash, modulusLength, publicExponent }, |
This file contains 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
set incsearch | |
set laststatus=2 | |
set noshowmode | |
set ruler | |
set termguicolors | |
set ttimeout ttimeoutlen=0 | |
set viminfo= | |
call plug#begin() | |
Plug 'catppuccin/vim', {'as': 'catppuccin'} |
OlderNewer