-
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.
Merge pull request #243 from 97carmine/fresh
Migrate to fresh
- Loading branch information
Showing
132 changed files
with
1,389 additions
and
9,835 deletions.
There are no files selected for viewing
This file was deleted.
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
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,48 +1,28 @@ | ||
FROM node:lts-alpine as builder | ||
FROM alpine/git:latest as repo | ||
|
||
WORKDIR /opt/app | ||
ENV DENO_DEPLOYMENT_ID=true | ||
|
||
COPY . . | ||
WORKDIR /opt | ||
|
||
RUN npm rm -g npm \ | ||
&& rm /usr/local/bin/yarn /usr/local/bin/yarnpkg \ | ||
&& rm -r /opt/yarn-v${YARN_VERSION} \ | ||
&& corepack enable \ | ||
&& yarn config set enableMirror false \ | ||
&& yarn config set enableInlineBuilds true \ | ||
&& yarn install \ | ||
&& yarn build:prod \ | ||
&& yarn cache clean | ||
RUN git clone --depth 1 -b fresh --single-branch https://github.com/97carmine/portfolio | ||
|
||
FROM node:lts-alpine | ||
FROM denoland/deno:alpine | ||
|
||
ENV NODE_ENV=production | ||
RUN apk update --no-cache | ||
|
||
RUN npm rm -g npm \ | ||
&& rm /usr/local/bin/yarn /usr/local/bin/yarnpkg \ | ||
&& rm -r /opt/yarn-v${YARN_VERSION} \ | ||
&& corepack enable \ | ||
&& apk update \ | ||
&& apk upgrade \ | ||
&& mkdir /home/node/app \ | ||
&& chown -R node:node /home/node/app | ||
USER deno | ||
|
||
USER node | ||
WORKDIR /home/deno/app/ | ||
|
||
WORKDIR /home/node/app/ | ||
COPY --from=repo --chown=deno:deno /opt/portfolio/web . | ||
COPY --from=repo --chown=deno:deno /opt/portfolio/.docker/web/healthcheck.ts . | ||
|
||
COPY --chown=node:node --from=builder /opt/app/build ./build | ||
COPY --chown=node:node --from=builder /opt/app/package.json \ | ||
/opt/app/.yarnrc.yml /opt/app/.docker/web/healthcheck.mjs ./ | ||
RUN sed -i 's/"healthcheck": "deno run --allow-net ..\/.docker\/web\/healthcheck.ts"/"healthcheck": "deno run --allow-net healthcheck.ts"/g' deno.json \ | ||
&& deno cache main.ts | ||
|
||
RUN yarn plugin import @yarnpkg/plugin-workspace-tools \ | ||
&& yarn workspaces focus --production \ | ||
&& rm .yarnrc.yml .yarn/install-state.gz \ | ||
&& rm -r .yarn/plugins | ||
|
||
EXPOSE 3000 | ||
EXPOSE 8000 | ||
|
||
HEALTHCHECK --interval=1m30s --timeout=10s --start-period=30s --retries=3 \ | ||
CMD node healthcheck.mjs | ||
CMD deno task healthcheck | ||
|
||
CMD node --require=$(pwd)/.pnp.cjs build/server.js | ||
CMD ["run", "--allow-net","--allow-read","--allow-env","--allow-write","--allow-run","main.ts"] |
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
fetch("http://localhost:8000/", { | ||
method: "GET", | ||
mode: "same-origin", | ||
cache: "no-cache", | ||
credentials: "omit", | ||
}) | ||
.then(({ ok, status, statusText }) => { | ||
if(ok) { | ||
console.log(`Response successful: ${status} - ${statusText}`); | ||
} else { | ||
throw `Response error: ${status} - ${statusText}`; | ||
} | ||
}) | ||
.catch(({ message }: Error) => { | ||
throw `Error executing fetch: ${message}`; | ||
}); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"$schema": "https://docs.renovatebot.com/renovate-schema.json", | ||
"extends": ["config:base", ":enableVulnerabilityAlerts"], | ||
"postUpdateOptions": ["yarnDedupeHighest"], | ||
"recreateClosed": true | ||
} |
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,15 +1,8 @@ | ||
# Node | ||
.pnp.* | ||
.yarn | ||
|
||
# production | ||
build | ||
src/common/languages/messages/**.json | ||
|
||
# IDE | ||
.vscode | ||
|
||
# misc | ||
.directory | ||
*.bak | ||
*.env | ||
*.env | ||
*.ini |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
Oops, something went wrong.