Compare commits

..

6 Commits

Author SHA1 Message Date
b1ek 24ad532a1e
replace static/dist instead of moving 2023-03-11 11:43:05 +10:00
b1ek 8c8d5ab9c7
completely fix black terminal colors 2023-03-10 22:00:52 +10:00
b1ek 6f74986b42
build resume on startup 2023-03-10 17:39:27 +10:00
b1ek 2cda8b607e
add docker dev/prod variants 2023-03-10 17:39:12 +10:00
b1ek 960ccfc994
remove dockerfile 2023-03-10 17:35:11 +10:00
b1ek d79d696ba4
remove docker compose 2023-03-10 17:34:07 +10:00
8 changed files with 34 additions and 4 deletions

6
.gitignore vendored
View File

@ -1,7 +1,7 @@
# package management
node_modules
package-lock.json
pnpm-lock.yaml
pnpm-lock.yml
yarn.lock
# env
@ -9,3 +9,7 @@ yarn.lock
# code
!*.js
# docker
docker-compose.yml
Dockerfile

View File

@ -8,4 +8,4 @@ RUN cat .gitignore | xargs rm -rf && \
npm i && \
./install
CMD [ "bash", "-c", "if [[ $APP_DEBUG == 'true' ]]; then npm run dev; else npm run prod; fi" ]
CMD [ "npm", "run", "dev" ]

11
Dockerfile.prod Normal file
View File

@ -0,0 +1,11 @@
FROM node:19
WORKDIR /opt/code
COPY . /opt/code
RUN cat .gitignore | xargs rm -rf && \
npm i --prod && \
./install
CMD [ "npm", "run", "prod" ]

0
docker-compose.prod Normal file
View File

View File

@ -5,7 +5,7 @@ div#resume_js_app {
border: 1px solid #e1e1e1;
font-family: monospace;
box-shadow: 0 2px 4px #30303060;
color: #e1e1e1;
color: #e1e1e1 !important;
}
div#resume_js_app p.js_loading_indicator {
padding: 0; margin: 0;
@ -15,3 +15,7 @@ div#resume_js_app p.js_loading_indicator {
width: fit-content;
text-align: center;
}
div#resume_js_app * {
color: #e1e1e1;
}

View File

@ -3,4 +3,5 @@
rm -rf dist/*
yarn run build
rm -rf ../../public/static/dist
mv dist ../../public/static

View File

@ -21,6 +21,16 @@ require('dotenv').config({
if (process.env.APP_DEBUG == 'true') {
process.env.APP_DEBUG = true;
process.env.DEBUG = '*/*';
} else {
process.env.DEBUG = null;
process.env.NODE_DEBUG = null;
process.env.APP_DEBUG = false;
}
// build resume page
if ((!fs.existsSync('public/static/dist/resume.js')) && (!process.env.APP_DEBUG)) {
console.log('Resume files do not exist, building it automatically...');
exec('react/resume/build.sh');
}
// load key