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
name: Build Docker Image | |
on: | |
push: | |
branches: ['main'] | |
jobs: | |
build_api: | |
runs-on: ubuntu-latest | |
steps: |
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
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 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
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 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
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 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
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 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
server { | |
gzip off; | |
gzip_static on; | |
location / { | |
root /usr/share/nginx/html; | |
try_files $uri $uri/ /index.html; | |
} | |
} |
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
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 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
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: |
NewerOlder