move build to cmd

This commit is contained in:
Karol Wypchlo 2021-02-20 17:08:25 +01:00
parent 14f06a4ddb
commit 20876562a6
2 changed files with 9 additions and 8 deletions

View File

@ -2,13 +2,15 @@ FROM node:15.8.0-alpine
WORKDIR /usr/app WORKDIR /usr/app
COPY public ./public
COPY src ./src
COPY styles ./styles
COPY package.json . COPY package.json .
COPY postcss.config.js .
COPY tailwind.config.js .
ENV NEXT_TELEMETRY_DISABLED 1 ENV NEXT_TELEMETRY_DISABLED 1
RUN yarn --no-lockfile RUN yarn --no-lockfile
COPY public ./public
COPY src ./src
COPY styles ./styles
COPY postcss.config.js .
COPY tailwind.config.js .
CMD ["sh", "-c", "yarn build && yarn start"] CMD ["sh", "-c", "yarn build && yarn start"]

View File

@ -10,8 +10,7 @@ import { SkynetClient } from "skynet-js";
const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : "";
const fetcher = (url) => fetch(url).then((r) => r.json()); const fetcher = (url) => fetch(url).then((r) => r.json());
export const getServerSideProps = authServerSideProps(); export const getServerSideProps = authServerSideProps(() => {
export const getStaticProps = () => {
const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API); const skynetClient = new SkynetClient(process.env.SKYNET_PORTAL_API);
const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink); const getSkylinkLink = ({ skylink }) => skynetClient.getSkylinkUrl(skylink);
const getRelativeDate = ({ uploadedOn }) => dayjs(uploadedOn).format("YYYY-MM-DD HH:mm:ss"); const getRelativeDate = ({ uploadedOn }) => dayjs(uploadedOn).format("YYYY-MM-DD HH:mm:ss");
@ -24,7 +23,7 @@ export const getStaticProps = () => {
const actions = []; const actions = [];
return { props: { headers, actions } }; return { props: { headers, actions } };
}; });
export default function Uploads({ headers, actions }) { export default function Uploads({ headers, actions }) {
const [offset, setOffset] = useState(0); const [offset, setOffset] = useState(0);