Skip to content

Commit 04695e2

Browse files
committed
example Blogger
1 parent b557f12 commit 04695e2

9 files changed

Lines changed: 13651 additions & 15836 deletions

File tree

examples/blogger/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ Flask web service (in `web_service/`), a Vue front-end (in `www/`), a HAProxy
55
reverse-proxy (in `reverse_proxy/`), and a PostgreSQL database (in `db/`).
66

77
In order to run it, do:
8+
89
```
910
$ docker compose up --build
1011
```
1112

1213
In addition to the default configuration which runs a single Skip service, this
13-
example can also run the Skip service in a distributed *leader-follower*
14-
configuration, with one *leader* handling writes and talking to the Postgres DB,
15-
and three *followers* which serve reactive streams to clients, sharing the load
14+
example can also run the Skip service in a distributed _leader-follower_
15+
configuration, with one _leader_ handling writes and talking to the Postgres DB,
16+
and three _followers_ which serve reactive streams to clients, sharing the load
1617
of computing and maintaining resources in a round-robin fashion.
1718

1819
This distributed configuration requires only configuration changes, is
1920
transparent to clients, and can be run with:
21+
2022
```
2123
$ docker compose -f compose.distributed.yml up --build
2224
```

examples/blogger/clean_install.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ process_directory() {
2222

2323
# Clean and install
2424
echo -e "${YELLOW}Cleaning $dir...${NC}"
25-
if ! npm run clean; then
25+
if ! pnpm clean; then
2626
echo -e "${RED}Error: Clean failed in $dir${NC}"
2727
cd - || return 1
2828
return 1
2929
fi
3030

3131
echo -e "${YELLOW}Installing dependencies in $dir...${NC}"
32-
if ! npm install; then
32+
if ! pnpm install; then
3333
echo -e "${RED}Error: Install failed in $dir${NC}"
3434
cd - || return 1
3535
return 1
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
FROM node:lts-alpine3.19
2+
RUN npm install -g pnpm
23
WORKDIR /app
3-
COPY package.json package.json
4-
RUN npm install
4+
COPY package.json pnpm-lock.yaml ./
5+
RUN pnpm install
56
COPY . .
6-
RUN npm run build
7+
RUN pnpm build
78
EXPOSE 8080 8081
89
HEALTHCHECK --interval=10s --timeout=1s --retries=10 CMD wget --spider http://localhost:8081/v1/healthcheck
9-
CMD ["npm", "start"]
10+
CMD ["pnpm", "start"]

0 commit comments

Comments
 (0)