Skip to content

Commit eee39f4

Browse files
committed
updated todo-front distributed
1 parent efbe080 commit eee39f4

File tree

15 files changed

+2426
-1868
lines changed

15 files changed

+2426
-1868
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
FROM node:12-alpine3.12 as builder
1+
FROM node:22-alpine AS builder
22

33
ARG API_HOST
44

55
WORKDIR /app
66

7-
COPY . .
7+
COPY . .
88

9-
RUN npm i
9+
RUN npm ci
1010

11-
RUN npm run build
11+
RUN npm run build
1212

13-
FROM nginx as frontend
13+
FROM nginx AS frontend
1414

15-
COPY --from=builder /app/dist /usr/share/nginx/html
15+
COPY --from=builder /app/dist /usr/share/nginx/html

02-orquestacion/exercises/02-distributed/todo-front/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
## Build to Test on local
44

55
```bash
6-
$ docker build -t lemoncode/todo-front --build-arg API_HOST=http://localhost:3000 .
6+
docker build -t lemoncode/todo-front --build-arg API_HOST=http://localhost:3000 .
77
```
88

99
## Running on local
1010

1111
```bash
12-
$ docker run -d -p 80:80 lemoncode/todo-front
12+
docker run -d -p 80:80 lemoncode/todo-front
1313
```
Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,59 @@
1-
const HtmlWebpackPlugin = require('html-webpack-plugin');
2-
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
3-
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
4-
const DotEnv = require('dotenv-webpack');
5-
const path = require('path');
1+
const HtmlWebpackPlugin = require("html-webpack-plugin");
2+
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
3+
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
4+
const DotEnv = require("dotenv-webpack");
5+
const path = require("path");
66

77
module.exports = {
8-
context: path.join(__dirname, '../', 'src'),
9-
resolve: {
10-
extensions: ['.js', '.ts', '.tsx']
11-
},
12-
entry: {
13-
app: ['./index.tsx'],
14-
appStyles: ['./styles.scss']
15-
},
16-
output: {
17-
filename: '[name].[chunkhash].js',
18-
path: path.resolve(process.cwd(), 'dist'),
19-
},
20-
module: {
21-
rules: [
22-
{
23-
test: /\.tsx?$/,
24-
exclude: /node_modules/,
25-
loader: 'babel-loader',
8+
context: path.join(__dirname, "../", "src"),
9+
resolve: {
10+
extensions: [".js", ".ts", ".tsx"],
11+
},
12+
entry: {
13+
app: ["./index.tsx"],
14+
appStyles: ["./styles.scss"],
15+
},
16+
output: {
17+
filename: "[name].[chunkhash].js",
18+
path: path.resolve(process.cwd(), "dist"),
19+
},
20+
module: {
21+
rules: [
22+
{
23+
test: /\.tsx?$/,
24+
exclude: /node_modules/,
25+
loader: "babel-loader",
26+
},
27+
{
28+
test: /\.scss$/,
29+
exclude: /node_modules/,
30+
use: [
31+
MiniCssExtractPlugin.loader,
32+
"css-loader",
33+
{
34+
loader: "sass-loader",
35+
options: {
36+
implementation: require("sass"),
2637
},
27-
{
28-
test: /\.scss$/,
29-
exclude: /node_modules/,
30-
use: [
31-
MiniCssExtractPlugin.loader,
32-
'css-loader',
33-
{
34-
loader: 'sass-loader',
35-
options: {
36-
implementation: require('sass'),
37-
}
38-
}
39-
]
40-
},
41-
]
42-
},
43-
plugins: [
44-
new HtmlWebpackPlugin({
45-
filename: 'index.html',
46-
template: 'index.html',
47-
}),
48-
new CleanWebpackPlugin(),
49-
new MiniCssExtractPlugin({
50-
filename: '[name].css',
51-
chunkFilename: '[id].css',
52-
}),
53-
new DotEnv({
54-
path: './.env',
55-
allowEmptyValues: true,
56-
systemvars: true,
57-
}),
38+
},
39+
],
40+
},
5841
],
59-
};
42+
},
43+
plugins: [
44+
new HtmlWebpackPlugin({
45+
filename: "index.html",
46+
template: "index.html",
47+
}),
48+
new CleanWebpackPlugin(),
49+
new MiniCssExtractPlugin({
50+
filename: "[name].css",
51+
chunkFilename: "[id].css",
52+
}),
53+
new DotEnv({
54+
path: "./.env",
55+
allowEmptyValues: true,
56+
systemvars: true,
57+
}),
58+
],
59+
};

02-orquestacion/exercises/02-distributed/todo-front/config/webpack.dev.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ const { merge } = require('webpack-merge');
22
const common = require('./webpack.common');
33

44
module.exports = merge(common, {
5-
mode: 'development',
6-
devtool: 'eval-source-map',
7-
devServer: {
8-
proxy: {
9-
'/api/': 'http://localhost:3000',
10-
},
11-
port: 8081,
5+
mode: 'development',
6+
devtool: 'eval-source-map',
7+
devServer: {
8+
proxy: {
9+
'/api/': 'http://localhost:3000',
1210
},
13-
});
11+
port: 8081,
12+
},
13+
});

0 commit comments

Comments
 (0)