initial commit

This commit is contained in:
DataHearth 2023-01-04 14:08:00 +01:00
commit 668a1f018b
No known key found for this signature in database
GPG Key ID: E88FD356ACC5F3C4
6 changed files with 112 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
Justfile
Dockerfile
.dockerignore

36
.env Normal file
View File

@ -0,0 +1,36 @@
# Server + Client
TZ=UTC
PUBLIC_URL=http://localhost:3000
PUBLIC_SERVER_URL=http://localhost:3100
PUBLIC_GOOGLE_CLIENT_ID=
# Server + Database
POSTGRES_DB=postgres
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
# Server
SECRET_KEY=CHANGEME
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_SSL_CERT=
JWT_SECRET=CHANGEME
JWT_EXPIRY_TIME=604800
GOOGLE_CLIENT_SECRET=
GOOGLE_API_KEY=
MAIL_FROM_NAME=
MAIL_FROM_EMAIL=
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
STORAGE_BUCKET=
STORAGE_REGION=
STORAGE_ENDPOINT=
STORAGE_URL_PREFIX=
STORAGE_ACCESS_KEY=
STORAGE_SECRET_KEY=
PDF_DELETION_TIME=345600000
# Client
PUBLIC_FLAG_DISABLE_SIGNUPS=false

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
FROM node:lts-bullseye-slim
ARG VERSION
RUN apt update
RUN apt install -y git
RUN git clone --depth 1 --branch ${VERSION} https://github.com/AmruthPillai/Reactive-Resume.git app
RUN npm install -g pnpm pm2
WORKDIR /app
RUN pnpm install --frozen-lockfile
RUN pnpm build
COPY . .
RUN cp .env /tmp/.env
RUN mv entrypoint.sh /usr/bin/entrypoint.sh && chmod a+x /usr/bin/entrypoint.sh
ENTRYPOINT [ "/usr/bin/entrypoint.sh" ]
CMD [ "pm2-runtime", "ecosystem.config.js" ]

27
Justfile Normal file
View File

@ -0,0 +1,27 @@
default: build-latest
LATEST_VERSION := `xh https://api.github.com/repos/AmruthPillai/Reactive-Resume/releases/latest Accept:application/vnd.github+json X-GitHub-Api-Version:2022-11-28 | jq .tag_name`
# build and push latest version of reactive-resume to "gitea" and "docker"
build-latest:
@echo "building images..."
docker build -t gitea.antoine-langlois.net/datahearth/reactive-resume:{{LATEST_VERSION}} --build-arg VERSION={{LATEST_VERSION}} .
docker tag gitea.antoine-langlois.net/datahearth/reactive-resume:{{LATEST_VERSION}} gitea.antoine-langlois.net/datahearth/reactive-resume:latest
docker tag gitea.antoine-langlois.net/datahearth/reactive-resume:{{LATEST_VERSION}} datahearth/reactive-resume:{{LATEST_VERSION}}
docker tag gitea.antoine-langlois.net/datahearth/reactive-resume:{{LATEST_VERSION}} datahearth/reactive-resume:latest
@echo "pushing images..."
docker push gitea.antoine-langlois.net/datahearth/reactive-resume:{{LATEST_VERSION}}
docker push gitea.antoine-langlois.net/datahearth/reactive-resume:latest
docker push datahearth/reactive-resume:{{LATEST_VERSION}}
docker push datahearth/reactive-resume:latest
# build and push specific version of reactive-resume to "gitea" and "docker"
build VERSION:
@echo "building images..."
docker build -t gitea.antoine-langlois.net/datahearth/reactive-resume:{{VERSION}} --build-arg VERSION={{VERSION}} .
docker tag gitea.antoine-langlois.net/datahearth/reactive-resume:{{VERSION}} datahearth/reactive-resume:{{VERSION}}
@echo "pushing images..."
docker push gitea.antoine-langlois.net/datahearth/reactive-resume:{{VERSION}}
docker push datahearth/reactive-resume:{{VERSION}}

12
ecosystem.config.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = [
{
script: "pnpm start --filter server",
cwd: "/app",
name: "server",
},
{
script: "pnpm start --filter client",
cwd: "/app",
name: "client",
},
];

11
entrypoint.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [ ! -f .env ]; then
cp /tmp/.env .
fi
set -a
source .env
set +a
exec "$@"