Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Post Page #6

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Dockerfile*
.eslintrc
jest.config.js
yarn-error.log
.git
34 changes: 21 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
# FROM node:12 as builder
FROM node:12-alpine as BUILD_IMAGE

# COPY . /node
# WORKDIR /node
WORKDIR /app

# RUN yarn && yarn build
COPY package.json yarn.lock ./

# install dependencies
RUN yarn --frozen-lockfile

COPY . .

# build
RUN yarn build

# remove dev dependencies
RUN npm prune --production

### Production
FROM node:12-alpine

COPY . /node
# COPY --from=builder /node/.next /node/.next
COPY .next /node/.next
WORKDIR /app

WORKDIR /node
RUN yarn --production
# copy from build image
COPY --from=BUILD_IMAGE /app/package.json ./package.json
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
COPY --from=BUILD_IMAGE /app/.next ./.next
COPY --from=BUILD_IMAGE /app/public ./public

EXPOSE 3000
STOPSIGNAL SIGINT

ENTRYPOINT yarn start
CMD ["yarn", "start"]
3 changes: 3 additions & 0 deletions buildpack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
nodejs:
version: 12.12.0
8 changes: 6 additions & 2 deletions components/AdminSider.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import Link from 'next/link';
import { NextRouter, useRouter } from 'next/router';
import { Layout, Menu } from 'antd';

import { BarChartOutlined, UserOutlined, HomeOutlined, SettingOutlined, DashboardOutlined, ApiOutlined } from '@ant-design/icons';
import { BarChartOutlined, UserOutlined, HomeOutlined, SettingOutlined, DashboardOutlined, ApiOutlined, RocketOutlined } from '@ant-design/icons';
import style from '@styles/adminSider.module.scss';


const { Sider } = Layout;
const { Item } = Menu;
const AdminSider: React.FC = () => {
Expand All @@ -27,6 +27,10 @@ const AdminSider: React.FC = () => {
<Link href="/user">User</Link>
</Item>

<Item key="/post" className={style.item} icon={<RocketOutlined />}>
<Link href="/post">Posts</Link>
</Item>

<Item key="/request" className={style.item} icon={<ApiOutlined />}>
<Link href="/request">API request</Link>
</Item>
Expand Down
9 changes: 9 additions & 0 deletions pages/post/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const PostPage: React.FC = () => {
return (
<>
Postlist
</>
);
};

export default PostPage;