Skip to content

Commit

Permalink
Dev (#2)
Browse files Browse the repository at this point in the history
* addin support for Docker

* updating the docker configuration

* adding heroku.yml

* adding heroku.yml v

* adding heroku.yml v2

* adding heroku.yml v3
  • Loading branch information
migbash authored Nov 21, 2021
1 parent e592c31 commit 843b9f9
Show file tree
Hide file tree
Showing 8 changed files with 121 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM node:14.17-alpine

WORKDIR /app
COPY package.json package-lock.json ./
RUN npm i --no-optional

COPY . .

RUN npm run build

FROM node:14.17-slim

WORKDIR /app
COPY --from=0 /app .
COPY . .

EXPOSE 3000
CMD ["node", "./build"]
3 changes: 3 additions & 0 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile
84 changes: 84 additions & 0 deletions package-lock.json

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

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
"scripts": {
"dev": "svelte-kit dev --host",
"build": "svelte-kit build",
"start" : "node build",
"preview": "svelte-kit preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
},
"devDependencies": {
"@sveltejs/adapter-vercel": "next",
"@sveltejs/kit": "next",
"@types/cookie": "^0.4.1",
"@typescript-eslint/eslint-plugin": "^4.31.1",
Expand All @@ -25,7 +27,7 @@
"svelte-preprocess": "^4.9.4",
"tslib": "^2.3.1",
"typescript": "^4.4.3",
"@sveltejs/adapter-vercel": "next"
"@sveltejs/adapter-node": "^1.0.0-next.55"
},
"type": "module",
"dependencies": {
Expand Down
2 changes: 0 additions & 2 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
<!-- <link href="https://fonts.googleapis.com/css2?family=Roboto+Slab:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet"> -->
<!-- <link href="https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap" rel="stylesheet"> -->

<link rel="icon" href="/favicon.png" />

%svelte.head%
</head>
<body>
Expand Down
12 changes: 6 additions & 6 deletions src/routes/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@

<style>
#background-image {
background-image: url('$lib/header-background.svg');
background-repeat: no-repeat;
background-size: auto;
background-origin: border-box;
background-position: inherit;
height: 495px;
background-image: url(/src/lib/header-background.svg);
background-repeat: no-repeat;
background-size: cover;
background-origin: border-box;
background-position: bottom;
height: 495px;
}
section {
Expand Down
7 changes: 5 additions & 2 deletions svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import vercel from '@sveltejs/adapter-vercel';
// import vercel from '@sveltejs/adapter-vercel';
import node from '@sveltejs/adapter-node';
import preprocess from 'svelte-preprocess';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -11,7 +12,9 @@ const config = {
// hydrate the <div id="svelte"> element in src/app.html
target: '#svelte',
// ... adding vercel support ...
adapter: vercel()
// adapter: vercel()
// ... NODE-JS deployment Environment ...
adapter: node()
}
};

Expand Down

0 comments on commit 843b9f9

Please sign in to comment.