Skip to content

Commit

Permalink
fix: docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
stonith404 committed Dec 2, 2022
1 parent 6336855 commit e958a83
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 186 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,5 @@ COPY --from=backend-builder /opt/app/prisma ./prisma
COPY --from=backend-builder /opt/app/package.json ./
WORKDIR /opt/app

RUN npm i -g dotenv-cli

EXPOSE 3000
CMD cd frontend && dotenv node_modules/.bin/next start & cd backend && npm run prod
CMD cd frontend && node_modules/.bin/next start & cd backend && npm run prod
28 changes: 0 additions & 28 deletions backend/package-lock.json

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

7 changes: 3 additions & 4 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "0.0.1",
"scripts": {
"build": "nest build",
"dev": "dotenv -- nest start --watch",
"prod": "npx prisma migrate deploy && dotenv node dist/main",
"dev": "nest start --watch",
"prod": "prisma migrate deploy && prisma db seed && node dist/src/main",
"lint": "eslint 'src/**/*.ts'",
"format": "prettier --write 'src/**/*.ts'",
"test:system": "npx prisma migrate reset -f && nest start & sleep 10 && newman run ./test/system/newman-system-tests.json"
"test:system": "prisma migrate reset -f && nest start & sleep 10 && newman run ./test/system/newman-system-tests.json"
},
"prisma": {
"seed": "ts-node prisma/seed/config.seed.ts"
Expand Down Expand Up @@ -55,7 +55,6 @@
"@typescript-eslint/eslint-plugin": "^5.40.0",
"@typescript-eslint/parser": "^5.40.0",
"cross-env": "^7.0.3",
"dotenv-cli": "^6.0.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
87 changes: 86 additions & 1 deletion backend/prisma/seed/config.seed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,90 @@
import { PrismaClient } from "@prisma/client";
import configVariables from "../../src/configVariables";
import * as crypto from "crypto";

const configVariables = [
{
key: "setupFinished",
description: "Whether the setup has been finished",
type: "boolean",
value: "false",
secret: false,
locked: true,
},
{
key: "appUrl",
description: "On which URL Pingvin Share is available",
type: "string",
value: "http://localhost:3000",
secret: false,
},
{
key: "showHomePage",
description: "Whether to show the home page",
type: "boolean",
value: "true",
secret: false,
},
{
key: "allowRegistration",
description: "Whether registration is allowed",
type: "boolean",
value: "true",
secret: false,
},
{
key: "allowUnauthenticatedShares",
description: "Whether unauthorized users can create shares",
type: "boolean",
value: "false",
secret: false,
},
{
key: "maxFileSize",
description: "Maximum file size in bytes",
type: "number",
value: "1000000000",
secret: false,
},
{
key: "jwtSecret",
description: "Long random string used to sign JWT tokens",
type: "string",
value: crypto.randomBytes(256).toString("base64"),
locked: true,
},
{
key: "emailRecipientsEnabled",
description:
"Whether to send emails to recipients. Only set this to true if you entered the host, port, email and password of your SMTP server.",
type: "boolean",
value: "false",
secret: false,
},
{
key: "smtpHost",
description: "Host of the SMTP server",
type: "string",
value: "",
},
{
key: "smtpPort",
description: "Port of the SMTP server",
type: "number",
value: "",
},
{
key: "smtpEmail",
description: "Email address of the SMTP server",
type: "string",
value: "",
},
{
key: "smtpPassword",
description: "Password of the SMTP server",
type: "string",
value: "",
},
];

const prisma = new PrismaClient();

Expand Down
88 changes: 0 additions & 88 deletions backend/src/configVariables.ts

This file was deleted.

58 changes: 0 additions & 58 deletions frontend/package-lock.json

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

5 changes: 2 additions & 3 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "pingvin-share",
"version": "0.0.1",
"scripts": {
"dev": "dotenv next dev",
"dev": "next dev",
"build": "next build",
"start": "dotenv next start",
"start": "next start",
"lint": "next lint",
"format": "prettier --write \"src/**/*.ts*\""
},
Expand Down Expand Up @@ -37,7 +37,6 @@
"@types/react": "18.0.4",
"@types/react-dom": "18.0.0",
"axios": "^0.26.1",
"dotenv-cli": "^6.0.0",
"eslint": "8.13.0",
"eslint-config-next": "^13.0.0",
"eslint-config-prettier": "^8.5.0",
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function App({ Component, pageProps }: AppProps) {
configVariables.filter((variable) => variable.key)[0].value == "false" &&
!["/auth/signUp", "/admin/setup"].includes(router.asPath)
) {
router.push(!user ? "/auth/signUp" : "admin/setup");
router.push(!user ? "/auth/signUp" : "/admin/setup");
}
}, [router.asPath]);

Expand Down

0 comments on commit e958a83

Please sign in to comment.