Skip to content

Instantly share code, notes, and snippets.

👨‍💻
Building the future.

Marvin Tunji-ola Marvinified

👨‍💻
Building the future.
Block or report user

Report or block Marvinified

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Marvinified
Marvinified / Update-branch.md
Created May 20, 2019 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.
View Update-branch.md

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

View package.json
{
...
"scripts": {
...
"prod:build": "docker-compose -f docker-compose.yml -f production.yml build",
"prod:up": "docker-compose -f docker-compose.yml -f production.yml up -d --build"
}
...
}
View production.yml
# production.yml
version: '3.5'
services:
web:
build:
context: .
dockerfile: Dockerfile-production
ports:
View nginx.conf
server {
listen 80;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
View Dockerfile-production
#==================== Building Stage=======================#
# Create the image based on the official Node 10 image from Dockerhub
FROM node:10 as node
# Create a new directory
RUN mkdir -p /app
# Change directory so that our commands run inside this new directory
WORKDIR /app
View package.json
{
"scripts": {
...
"start": "CHOKIDAR_USEPOLLING=true react-scripts start",
"dev:up": "docker-compose -f docker-compose.yml -f dev.yml up",
"dev:build": "docker-compose -f docker-compose.yml -f dev.yml build"
...
}
}
View dev.yml
#Filename: dev.yml
version: '3.5'
services:
web:
command: npm start
build:
context: .
dockerfile: Dockerfile
ports:
- 3000:3000
View docker-compose.yml
#Filename: docker-compose.yml
version: '3.5'
services:
web:
volumes:
- .:/app
- /app/node_modules
View Dockerfile
#Filename: Dockerfile
FROM node:10
# Create a work directory and copy over our dependency manifest files.
RUN mkdir /app
WORKDIR /app
COPY /src /app/src
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install
#Expose Port 3000 since this is our dev environment
EXPOSE 3000
You can’t perform that action at this time.