Last active
July 12, 2023 12:36
-
-
Save junaidulqayyumqureshi/914cd104fd2f9cc1c222f2836f4141e1 to your computer and use it in GitHub Desktop.
Research & Findings on CLOUD based website deployments, Development snippets & more
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
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!!!
Recover EC2 instance & Connect without key pair
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
CLAMAV Antivirus
https://www.atlantic.net/vps-hosting/how-to-install-clamav-on-ubuntu-20-04-and-scan-for-vulnerabilities/