-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
319 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# .dockerignore | ||
|
||
.vscode | ||
|
||
node_modules | ||
|
||
.git | ||
.gitattributes | ||
|
||
.eslintignore | ||
.eslintrc.cjs | ||
|
||
.prettierrc | ||
.pretieriignore | ||
|
||
README.md | ||
|
||
Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Build the first stage with alpine node image and name as build | ||
FROM node:18-alpine3.17 as build | ||
|
||
# update and install the latest dependencies on docker base image | ||
# Add non root user to the docker image and set the user | ||
RUN apk update && apk upgrade && adduser -D svelteuser | ||
USER svelteuser | ||
|
||
# set work dir as app | ||
WORKDIR /app | ||
|
||
# copy the sveltkit project content with proper permission for the user svelteuser | ||
COPY --chown=svelteuser:svelteuser . /app | ||
|
||
# install all the project npm dependencies and | ||
# build the svelte project to generate the artifacts in build directory | ||
RUN npm install && npm run build | ||
|
||
# we are using multi stage build process to keep the image size as small as possible | ||
FROM node:18-alpine3.17 | ||
# update and install latest dependencies, add dumb-init package | ||
# add and set non root user | ||
RUN apk update && apk upgrade && apk add dumb-init && adduser -D svelteuser | ||
USER svelteuser | ||
|
||
# set work dir as app | ||
WORKDIR /app | ||
|
||
# copy the build directory to the /app directory of second stage | ||
COPY --chown=svelteuser:svelteuser --from=build /app/build /app/package.json ./ | ||
|
||
# expose 8080 on container | ||
EXPOSE 8080 | ||
|
||
# set app host and port and env as production | ||
ENV HOST=0.0.0.0 PORT=8080 NODE_ENV=production | ||
|
||
# start the app with dumb init to spawn the Node.js runtime process | ||
# with signal support | ||
CMD ["dumb-init","node","index.js"] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,23 @@ | ||
<script lang="ts"> | ||
let oldPassword: string; | ||
let newPassword: string; | ||
let newPasswortRepeated: string; | ||
</script> | ||
|
||
<div> | ||
<h1>home</h1> | ||
<div class="mt-5 card p-4"> | ||
<div class="w-1/3"> | ||
<label class="block text-sm font-bold mb-1">Old Password</label> | ||
<input class="input w-full px-4 py-2 border rounded-lg" type="text" placeholder="Enter key" bind:value={oldPassword} on:input={() => {}} /> | ||
</div> | ||
<div class="w-1/3"> | ||
<label class="block text-sm font-bold mb-1">New Password</label> | ||
<input class="input w-full px-4 py-2 border rounded-lg" type="text" placeholder="Enter key" bind:value={newPassword} on:input={() => {}} /> | ||
</div> | ||
<div class="w-1/3"> | ||
<label class="block text-sm font-bold mb-1">New Password Repeated</label> | ||
<input class="input w-full px-4 py-2 border rounded-lg" type="text" placeholder="Enter key" bind:value={newPasswortRepeated} on:input={() => {}} /> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.