Commit 6cf25b38 authored by Ken's avatar Ken

add production deploy stage

parent 141a4e7c
node_modules
build
Dockerfile
.dockerignore
.gitignore
.git
*.md
*.txt
*.bat
\ No newline at end of file
FROM node:16-alpine as builder
WORKDIR /app
COPY . .
RUN npm install
# For production
RUN npm run build
FROM nginx:stable
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=builder ./app/build /usr/share/nginx/html
type password.txt| docker login -u leekfsolo --password-stdin
docker-compose down
docker-compose pull
docker-compose up -d
docker logout
version: "3.4"
services:
newssite-fe:
image: leekfsolo/news_site_fe
container_name: news_site_fe
ports:
- "80:80"
restart: unless-stopped
pull_policy: always
server {
listen 80;
location / {
root /usr/share/nginx/html/;
include /etc/nginx/mime.types;
try_files $uri $uri/ /index.html;
}
}
\ No newline at end of file
dckr_pat_so4nqDK9kEBqY6bK-0FN-y799v4
\ No newline at end of file
public/favicon.ico

3.78 KB | W: | H:

public/favicon.ico

90.9 KB | W: | H:

public/favicon.ico
public/favicon.ico
public/favicon.ico
public/favicon.ico
  • 2-up
  • Swipe
  • Onion skin
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head>
<meta charset="utf-8" /> <head>
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="theme-color" content="#000000" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<meta <meta name="theme-color" content="#000000" />
name="description" <meta name="description" content="Latest VN news, world news, sports, business, opinion, analysis and reviews from MEU Newspaper." />
content="Web site created using create-react-app" <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
/> <!--
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
manifest.json provides metadata used when your web app is installed on a manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> -->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" /> <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!-- <!--
Notice the use of %PUBLIC_URL% in the tags above. Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build. It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML. Only files inside the `public` folder can be referenced from the HTML.
...@@ -24,12 +22,13 @@ ...@@ -24,12 +22,13 @@
work correctly both with client-side routing and a non-root public URL. work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`. Learn how to configure a non-root public URL by running `npm run build`.
--> -->
<title>React App</title> <title>MEU Newspaper</title>
</head> </head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript> <body>
<div id="root"></div> <noscript>You need to enable JavaScript to run this app.</noscript>
<!-- <div id="root"></div>
<!--
This HTML file is a template. This HTML file is a template.
If you open it directly in the browser, you will see an empty page. If you open it directly in the browser, you will see an empty page.
...@@ -39,5 +38,6 @@ ...@@ -39,5 +38,6 @@
To begin the development, run `npm start` or `yarn start`. To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`. To create a production bundle, use `npm run build` or `yarn build`.
--> -->
</body> </body>
</html>
</html>
\ No newline at end of file
type password.txt| docker login -u leekfsolo --password-stdin
docker build -t leekfsolo/news_site_fe -f ./Dockerfile .
docker push leekfsolo/news_site_fe:latest
docker logout
const enviromentConfig = { const enviromentConfig = {
development: { development: {
endPoint: "https://localhost:5001", endPoint: "https://gateway.dev.meu-solutions.com/newspapers",
}, },
production: { production: {
endPoint: "", endPoint: "https://gateway.dev.meu-solutions.com/newspapers",
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment