Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

allow for running dev environment inside docker

Amruth Pillai849aad64970b
diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml
index efc9ef5c2..437e06a9f 100644
--- a/.github/workflows/autofix.yml
+++ b/.github/workflows/autofix.yml
@@ -26,7 +26,7 @@ jobs:
cache: true
- name: Install Dependencies
- run: vp install
+ run: vp install --frozen-lockfile
- name: Run Tests
run: vp test
diff --git a/Dockerfile.dev b/Dockerfile.dev
new file mode 100644
index 000000000..837cecd1a
--- /dev/null
+++ b/Dockerfile.dev
@@ -0,0 +1,21 @@
+# syntax=docker/dockerfile:1
+
+# ---------- Development Layer ----------
+FROM node:24-slim AS development
+
+ENV NODE_ENV="development"
+ENV PNPM_HOME="/pnpm"
+ENV PATH="$PNPM_HOME:$PATH"
+
+RUN corepack enable
+
+WORKDIR /app
+
+COPY package.json pnpm-lock.yaml ./
+
+RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
+ pnpm install --frozen-lockfile
+
+EXPOSE 3000
+
+CMD ["pnpm", "run", "dev"]
diff --git a/compose.dev.yml b/compose.dev.yml
index d5d17630b..67fa6a416 100644
--- a/compose.dev.yml
+++ b/compose.dev.yml
@@ -20,15 +20,15 @@ services:
image: postgres:latest
restart: unless-stopped
environment:
- - POSTGRES_DB=postgres
- - POSTGRES_USER=postgres
- - POSTGRES_PASSWORD=postgres
+ POSTGRES_DB: postgres
+ POSTGRES_USER: postgres
+ POSTGRES_PASSWORD: postgres
volumes:
- postgres_data:/var/lib/postgresql
ports:
- "5432:5432"
healthcheck:
- test: ["CMD", "pg_isready", "-U", "postgres", "-d", "postgres"]
+ test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
start_period: 10s
interval: 30s
timeout: 10s
@@ -40,10 +40,10 @@ services:
ports:
- "4000:3000"
environment:
- - QUEUED=10
- - HEALTH=true
- - CONCURRENT=5
- - TOKEN=1234567890
+ QUEUED: 10
+ HEALTH: "true"
+ CONCURRENT: 5
+ TOKEN: "1234567890"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/pressure?token=1234567890"]
interval: 10s
@@ -63,8 +63,8 @@ services:
restart: unless-stopped
command: server -s3 -filer -dir=/data -ip=0.0.0.0
environment:
- - AWS_ACCESS_KEY_ID=seaweedfs
- - AWS_SECRET_ACCESS_KEY=seaweedfs
+ AWS_ACCESS_KEY_ID: seaweedfs
+ AWS_SECRET_ACCESS_KEY: seaweedfs
volumes:
- seaweedfs_data:/data
ports:
@@ -106,7 +106,50 @@ services:
timeout: 10s
retries: 3
+ web_app:
+ profiles: ["app"]
+ build:
+ context: .
+ dockerfile: Dockerfile.dev
+ restart: unless-stopped
+ ports:
+ - "3000:3000"
+ env_file:
+ - .env
+ environment:
+ PRINTER_APP_URL: http://web_app:3000
+ PRINTER_ENDPOINT: ws://browserless:3000?token=1234567890
+ DATABASE_URL: postgresql://postgres:postgres@postgres:5432/postgres
+ SMTP_HOST: mailpit
+ S3_ENDPOINT: http://seaweedfs:8333
+ CHOKIDAR_INTERVAL: 100
+ WATCHPACK_POLLING: "true"
+ CHOKIDAR_USEPOLLING: "true"
+ extra_hosts:
+ - "host.docker.internal:host-gateway"
+ volumes:
+ - ./:/app
+ - web_app_data:/app/data
+ - web_app_pnpm_store:/pnpm/store
+ - web_app_nitro_cache:/app/.nitro
+ - web_app_tanstack_cache:/app/.tanstack
+ - web_app_node_modules:/app/node_modules
+ depends_on:
+ postgres:
+ condition: service_healthy
+ browserless:
+ condition: service_healthy
+ seaweedfs:
+ condition: service_healthy
+ seaweedfs_create_bucket:
+ condition: service_completed_successfully
+
volumes:
mailpit_data:
postgres_data:
seaweedfs_data:
+ web_app_data:
+ web_app_node_modules:
+ web_app_pnpm_store:
+ web_app_tanstack_cache:
+ web_app_nitro_cache: