Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save junaidulqayyumqureshi/914cd104fd2f9cc1c222f2836f4141e1 to your computer and use it in GitHub Desktop.
Save junaidulqayyumqureshi/914cd104fd2f9cc1c222f2836f4141e1 to your computer and use it in GitHub Desktop.
Research & Findings on CLOUD based website deployments, Development snippets & more
@junaidulqayyumqureshi
Copy link
Author

Deployment on DigitalOcean Apps Platform of a docker react app

1- Create file named "Dockerfile" (Without any extension)
2- Create folder called .docker on root and create a file in it with name "prod.Dockerfile"

Copy below content in both the files

# Use an official Node.js runtime as a parent image
FROM node:14-alpine

# Set the working directory to /app
WORKDIR /build

# Copy the package.json and package-lock.json files to the container
COPY package*.json ./

# Install the dependencies
RUN npm install

# Install the dependencies
RUN npm install -g serve

# Copy the remaining application files to the container
COPY . .

# Build the application
RUN npm run build

# Set the production environment variable
ENV NODE_ENV=production

# Expose port 3000
EXPOSE 3000

# Start the application
CMD ["serve", "-s", "build"]

3- After that, create an app on app platform and choose this repo

4- Remove extra webservice instances, if any, other than Docker WebService.

5- Define a port i.e. 3000 in settings

6- Define start and build scripts in package.json i.e. react-scripts start

Voila!!!

@junaidulqayyumqureshi
Copy link
Author

Recover EC2 instance & Connect without key pair

https://www.youtube.com/watch?v=5btWXn4yWzQ

@junaidulqayyumqureshi
Copy link
Author

Permission Denied EC2 CodeCommit

sudo chown -R ubuntu .git/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment