Reactive Resume V4 with Docker

I was always looking for dynamic resume/cv updater but I never find something interesting. Today I was playing with some wordpress plugins but I remembered few months ago I was playing with something more interesting, like reactive resume.

I failed in that time because I had to manually create all the docker containers instead of playing directly with docker compose that is doing almost everything for you.

I prepared a proxmox lxc container with ubuntu 22.04 on arm and install all the depdencies. Requirements are 40G disk space (don’t ask me why), I assigned 8 cores and 2G of ram.

apt-get install htop nano mc curl net-tools
curl -sSL https://get.docker.com | sh
mkdir reactive-resume-v4
nano docker-compose.yml

Then paste this. Some resources into their github documentation.

version: "3.8"

# In this Docker Compose example, it assumes that you maintain a reverse proxy externally (or chose not to).
# The only two exposed ports here are from minio (:9000) and the app itself (:80).
# If these ports are changed, ensure that the env vars passed to the app are also changed accordingly.

services:
  # Database (Postgres)
  postgres:
    image: postgres:15-alpine
    restart: unless-stopped
    volumes:
      - postgres_data:/var/lib/postgresql/data
    environment:
      POSTGRES_DB: postgres
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Storage (for image uploads)
  minio:
    image: minio/minio
    restart: unless-stopped
    command: server /data
    ports:
      - 9000:9000
    volumes:
      - minio_data:/data
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin

  # Chrome Browser (for printing and previews)
  chrome:
    image: browserless/chrome:1.61.0-puppeteer-21.4.1
    restart: unless-stopped
    environment:
      TOKEN: chrome_token
      EXIT_ON_HEALTH_FAILURE: true
      PRE_REQUEST_HEALTH_CHECK: true

  # Redis (for cache & server session management)
  redis:
    image: redis:alpine
    restart: unless-stopped
    command: redis-server --requirepass password

  app:
    image: amruthpillai/reactive-resume:latest
    restart: unless-stopped
    ports:
      - 80:80
    depends_on:
      - postgres
      - minio
      - redis
      - chrome
    environment:
      # -- Environment Variables --
      PORT: 80
      NODE_ENV: production

      # -- URLs --
      PUBLIC_URL: http://${IP_ADDRESS}
      STORAGE_URL: http://${IP_ADDRESS}:9000/default

      # -- Printer (Chrome) --
      CHROME_TOKEN: chrome_token
      CHROME_URL: ws://chrome:3000

      # -- Database (Postgres) --
      DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
      # explain this url postgresql://postgres:postgres@postgres:5432/postgres  postgresql://username:password@host:port/database

      # -- Auth --
      ACCESS_TOKEN_SECRET: access_token_secret
      REFRESH_TOKEN_SECRET: refresh_token_secret

      # -- Emails --
      MAIL_FROM: noreply@localhost
      # SMTP_URL: smtp://user:pass@smtp:587 # Optional

      # -- Storage (Minio) --
      STORAGE_ENDPOINT: minio
      STORAGE_PORT: 9000
      STORAGE_REGION: us-east-1 # Optional
      STORAGE_BUCKET: default
      STORAGE_ACCESS_KEY: minioadmin
      STORAGE_SECRET_KEY: minioadmin
      STORAGE_USE_SSL: false

      # -- Cache (Redis) --
      REDIS_URL: redis://default:password@redis:6379

      GITHUB_CLIENT_ID: github_client_id
      GITHUB_CLIENT_SECRET: github_client_secret
      GITHUB_CALLBACK_URL: http://${IP_ADDRESS}:3000/api/auth/github/callback

      # -- Google (Optional) --
      GOOGLE_CLIENT_ID: google_client_id
      GOOGLE_CLIENT_SECRET: google_client_secret
      GOOGLE_CALLBACK_URL: http://${IP_ADDRESS}:3000/api/auth/google/callback

volumes:
  minio_data:
  postgres_data:

Save the file and create another file called .env and edit the file with nano .env

IP_ADDRESS=192.168.7.213

This is actually the IP address of my LXC container. Just change that with your IP address.
Next, we will use docker composer up to do the rest of the job. This will take up to 10 minutes, depends of your resources. 35G of space will be used after that. (I had to increase container live because I was not expecting this).

docker compose up -d

Here are my results:

Accesing in the browser http://192.168.7.213 i got this result:

Later edit:
Just because I want to have the download feature available, I had to do some adjustments after I checked why is not working. With portainer installed through docker, I was able to edit the env for “root-app-1”. What I modified?

STORAGE_URL 	https://resumedw.paulierco.ro/default
PUBLIC_URL 	https://resume.paulierco.ro

Did another domain: resumedw.paulierco.ro that is mapped to internal IP address (192.168.7.213) but with port 9000 in Cloudflare. Everything works as expected now.

To disable public registration you need to add this flag:

DISABLE_SIGNUPS true

For installing portainer:

docker volume create portainer_data
docker run -d -p 8000:8000 -p 9443:9443 --name portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest

Leave a reply:

Your email address will not be published.

Site Footer