Skip to content

Commit

Permalink
Added dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Yureien committed Jun 7, 2023
1 parent 4e68cf3 commit c84f1d9
Show file tree
Hide file tree
Showing 25 changed files with 888 additions and 78 deletions.
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Dockerfile
.dockerignore
.git
.gitignore
.gitattributes
README.md
.npmrc
.prettierrc
.eslintrc.cjs
.graphqlrc
.editorconfig
.svelte-kit
.vscode
node_modules
build
package
**/.env
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
DATABASE_URL="postgresql:https://johndoe:randompassword@localhost:5432/mydb?schema=public"
DATABASE_URL="postgresql:https://johndoe:randompassword@localhost:5432/mydb?schema=public"
SALT="randomsalt"
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:18-alpine AS builder

WORKDIR /app

COPY package.json yarn.lock src/lib/server/prisma/schema.prisma ./

RUN yarn install --frozen-lockfile

COPY . .

RUN npm run build
RUN npm prune --production

FROM node:18-alpine

WORKDIR /app

RUN npm install -g prisma pm2

COPY scripts/ scripts/
COPY package.json yarn.lock process.yml src/lib/server/prisma/schema.prisma ./

RUN yarn install --frozen-lockfile --production

COPY --from=builder /app/build build/

EXPOSE 3000

ENV NODE_ENV=production

CMD [ "./scripts/run.sh" ]
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
},
"devDependencies": {
"@sveltejs/adapter-auto": "^2.0.0",
"@sveltejs/adapter-node": "^1.2.4",
"@sveltejs/kit": "^1.5.0",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"autoprefixer": "^10.4.14",
Expand All @@ -24,15 +26,17 @@
"prettier": "^2.8.0",
"prettier-plugin-svelte": "^2.8.1",
"prisma": "^4.15.0",
"prismjs": "^1.29.0",
"svelte": "^3.54.0",
"svelte-check": "^3.0.1",
"svelte-select": "^5.6.1",
"tailwindcss": "^3.3.2",
"tslib": "^2.4.1",
"typescript": "^5.0.0",
"vite": "^4.3.0"
},
"type": "module",
"dependencies": {
"@prisma/client": "4.15.0"
"@prisma/client": "^4.15.0"
}
}
6 changes: 6 additions & 0 deletions process.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apps:
- name: 'app'
script: './build/index.js'
instances: 'max'
env:
NODE_ENV: 'production'
3 changes: 3 additions & 0 deletions scripts/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh
prisma migrate deploy
pm2-runtime process.yml
6 changes: 6 additions & 0 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@
@tailwind components;
@tailwind utilities;

:root {
--color-primary: #E5E1D1;
--color-background: #101419;
--color-dark: rgba(0, 0, 0, 0.4);
}

body {
@apply bg-background;
@apply text-primary;
Expand Down
Loading

0 comments on commit c84f1d9

Please sign in to comment.