Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.git
.gitignore
**/node_modules
frontend/.next
backend/uploads/*
backend/converted/*
!backend/uploads/.gitkeep
!backend/converted/.gitkeep
**/.env
**/.env.local
npm-debug.log*
README.md
nginx/certbot/
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copy the backend values to backend/.env
PORT=4000
FRONTEND_URL=http://localhost:3000
FILE_TTL_MS=3600000
CLEANUP_INTERVAL_MS=3600000
DAILY_CONVERSION_LIMIT=10
CONVERSION_LIMIT_WINDOW_MS=86400000
LIBREOFFICE_PATH=libreoffice
PDFTOPPM_PATH=pdftoppm
GHOSTSCRIPT_PATH=
PDF_TO_WORD_PROVIDER=auto
PYTHON_PATH=python
CONVERTAPI_TOKEN=
CONVERTAPI_BASE_URL=https://v2.convertapi.com/convert/pdf/to/docx

# Copy the frontend values to frontend/.env.local
NEXT_PUBLIC_API_URL=http://localhost:4000
NEXT_PUBLIC_SITE_URL=http://localhost:3000
3 changes: 3 additions & 0 deletions .env.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
LETSENCRYPT_EMAIL=admin@getqrly.com
PDF_TO_WORD_PROVIDER=auto
CONVERTAPI_TOKEN=
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules/
frontend/.next/
frontend/.env.local
backend/.env
backend/uploads/*
backend/converted/*
!backend/uploads/.gitkeep
!backend/converted/.gitkeep
npm-debug.log*
.DS_Store
137 changes: 137 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: file-convert-web

services:
frontend:
build:
context: .
dockerfile: frontend/Dockerfile
args:
NEXT_PUBLIC_SITE_URL: https://convert.getqrly.com
restart: unless-stopped
init: true
security_opt:
- no-new-privileges:true
environment:
NODE_ENV: production
PORT: 3000
HOSTNAME: 0.0.0.0
expose:
- "3000"
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:3000').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
networks:
- app_network

backend:
build:
context: .
dockerfile: backend/Dockerfile
restart: unless-stopped
init: true
security_opt:
- no-new-privileges:true
environment:
NODE_ENV: production
PORT: 4000
FRONTEND_URL: https://convert.getqrly.com
FILE_TTL_MS: 3600000
CLEANUP_INTERVAL_MS: 3600000
DAILY_CONVERSION_LIMIT: 10
CONVERSION_LIMIT_WINDOW_MS: 86400000
LIBREOFFICE_PATH: libreoffice
PDFTOPPM_PATH: pdftoppm
GHOSTSCRIPT_PATH: gs
PDF_TO_WORD_PROVIDER: ${PDF_TO_WORD_PROVIDER:-auto}
PYTHON_PATH: python3
CONVERTAPI_TOKEN: ${CONVERTAPI_TOKEN:-}
CONVERTAPI_BASE_URL: https://v2.convertapi.com/convert/pdf/to/docx
expose:
- "4000"
volumes:
- uploads_data:/app/backend/uploads
- converted_data:/app/backend/converted
healthcheck:
test:
[
"CMD",
"node",
"-e",
"fetch('http://127.0.0.1:4000/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
networks:
- app_network

nginx:
build:
context: .
dockerfile: nginx/Dockerfile
restart: unless-stopped
security_opt:
- no-new-privileges:true
environment:
DOMAIN: convert.getqrly.com
depends_on:
frontend:
condition: service_healthy
backend:
condition: service_healthy
ports:
- "80:80"
- "443:443"
volumes:
- letsencrypt_data:/etc/letsencrypt:ro
- certbot_webroot:/var/www/certbot:ro
healthcheck:
test:
[
"CMD-SHELL",
"wget -q -O - --header='Host: convert.getqrly.com' http://127.0.0.1/nginx-health | grep -q ok"
]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
networks:
- app_network

certbot:
image: certbot/certbot:latest
profiles:
- ssl
volumes:
- letsencrypt_data:/etc/letsencrypt
- certbot_webroot:/var/www/certbot
command:
- certonly
- --webroot
- --webroot-path=/var/www/certbot
- --email
- ${LETSENCRYPT_EMAIL:-admin@getqrly.com}
- --agree-tos
- --no-eff-email
- --domain
- convert.getqrly.com

networks:
app_network:
driver: bridge

volumes:
uploads_data:
converted_data:
letsencrypt_data:
certbot_webroot:
Loading