Skip to content

Commit

Permalink
[fix] Script errors of Docker building
Browse files Browse the repository at this point in the history
  • Loading branch information
TechQuery committed Nov 28, 2023
1 parent 05fa156 commit cb5e3f1
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 33 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ README.md
node_modules/
.eslintrc.json
.next/
.data/
.vercel/
start.sh
.husky/
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ RUN pnpm build

FROM base
COPY --from=prod-deps /app/node_modules /app/node_modules
COPY --from=build /app/dist /app/dist
COPY --from=build /app/.next /app/.next
EXPOSE 3000
CMD ["npm", "start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# iWebLog

Light-weight **Personal Web App** (PWA) based on [Next.js][3], [MobX][9] & [Sequelize][6]
Light-weight **Personal Web App** (PWA) based on [Next.js][3], [MobX][10] & [Sequelize][6]

[![CI & CD](https://github.com/idea2app/iWebLog/actions/workflows/main.yml/badge.svg)][7]

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@idea2app/web-log",
"version": "1.0.0-beta.2",
"version": "1.0.0-beta.3",
"description": "Light-weight Personal Web App (PWA) based on Next.js, MobX & Sequelize",
"private": true,
"dependencies": {
Expand All @@ -13,7 +13,7 @@
"@editorjs/list": "^1.9.0",
"@editorjs/paragraph": "^2.11.3",
"@editorjs/quote": "^2.6.0",
"@supabase/supabase-js": "^2.38.5",
"@supabase/supabase-js": "^2.39.0",
"editorjs-html": "^3.4.3",
"formidable": "^3.5.1",
"idea-react": "^1.0.0-rc.30",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@types/lodash": "^4.14.202",
"@types/node": "^18.18.13",
"@types/pg": "^8.10.9",
"@types/react": "^18.2.38",
"@types/react": "^18.2.39",
"eslint": "^8.54.0",
"eslint-config-next": "^14.0.3",
"eslint-config-prettier": "^9.0.0",
Expand All @@ -69,14 +69,14 @@
"*.{js,jsx,ts,tsx}": "eslint --fix"
},
"scripts": {
"prepare": "husky install",
"prepare": "husky install || true",
"dev": "next dev",
"build": "next build",
"export": "next build && next export",
"start": "next start",
"lint": "next lint",
"test": "lint-staged && npm run lint",
"pack-image": "docker build -t web-log:latest .",
"container": "docker rm -f web-log && docker run --name web-log -p 3000:3000 -d web-log:latest"
"pack-image": "docker build -t idea2app/web-log:latest .",
"container": "docker rm -f web-log && docker run --name web-log -p 3000:3000 -d idea2app/web-log:latest"
}
}
5 changes: 3 additions & 2 deletions pages/article/[id]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { observer } from 'mobx-react';
import { InferGetServerSidePropsType } from 'next';
import dynamic from 'next/dynamic';
import Head from 'next/head';
import { compose, errorLogger, translator } from 'next-ssr-middleware';
import { cache, compose, errorLogger, translator } from 'next-ssr-middleware';
import { FC } from 'react';
import { Badge, Button, Container, Image } from 'react-bootstrap';

Expand All @@ -21,6 +21,7 @@ const SessionBox = dynamic(() => import('../../../components/SessionBox'), {
{ t } = i18n;

export const getServerSideProps = compose<{ id: string }, ArticleData>(
cache(),
errorLogger,
translator(i18n),
async ({ params }) => {
Expand Down Expand Up @@ -49,7 +50,7 @@ const ArticleDetailPage: FC<
<Head>
<link
rel="stylesheet"
href="https://unpkg.com/github-markdown-css@5.2.0/github-markdown.css"
href="https://unpkg.com/github-markdown-css@5.4.0/github-markdown.css"
/>
</Head>

Expand Down
3 changes: 2 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { observer } from 'mobx-react';
import { ScrollList } from 'mobx-restful-table';
import { InferGetServerSidePropsType } from 'next';
import dynamic from 'next/dynamic';
import { compose, errorLogger, translator } from 'next-ssr-middleware';
import { cache, compose, errorLogger, translator } from 'next-ssr-middleware';
import { FC } from 'react';
import { Button, Container } from 'react-bootstrap';

Expand All @@ -18,6 +18,7 @@ const SessionBox = dynamic(() => import('../components/SessionBox'), {
{ t } = i18n;

export const getServerSideProps = compose(
cache(),
errorLogger,
translator(i18n),
async () => {
Expand Down
38 changes: 19 additions & 19 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion service/Article/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ export const init = (sequelize: Sequelize) =>
summary: { type: DataTypes.TEXT, allowNull: true },
content: DataTypes.TEXT,
},
{ sequelize },
{ sequelize, modelName: 'Article' },
);
2 changes: 1 addition & 1 deletion service/Comment/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const init = (sequelize: Sequelize) => {
content: DataTypes.TEXT,
parentId: { type: DataTypes.INTEGER, allowNull: true },
},
{ sequelize },
{ sequelize, modelName: 'Comment' },
);
Comment.Poster = Comment.belongsTo(User, { as: 'poster' });
};
2 changes: 1 addition & 1 deletion service/User/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export const init = (sequelize: Sequelize) =>
avatar: { type: DataTypes.STRING, allowNull: true },
roles: { type: DataTypes.JSON, allowNull: true },
},
{ sequelize },
{ sequelize, modelName: 'User' },
);

0 comments on commit cb5e3f1

Please sign in to comment.