diff --git a/docker-compose.production.yml b/docker-compose.production.yml new file mode 100644 index 0000000..82d014b --- /dev/null +++ b/docker-compose.production.yml @@ -0,0 +1,28 @@ +services: + redis: + image: redis:latest + ports: + - 6379:6379 + networks: + - filepizza + volumes: + - redis_data:/data + filepizza: + build: . + image: kern/filepizza:latest + ports: + - 80:80 + environment: + - PORT=80 + - REDIS_URL=redis://redis:6379 + networks: + - filepizza + depends_on: + - redis + +networks: + filepizza: + driver: bridge + +volumes: + redis_data: diff --git a/docker-compose.yml b/docker-compose.yml index 96613ae..59caa9e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,3 @@ -version: '3' services: redis: image: redis:latest @@ -6,9 +5,11 @@ services: - 6379:6379 networks: - filepizza + volumes: + - redis_data:/data filepizza: build: . - image: kern/filepizza:master + image: kern/filepizza:latest ports: - 8080:8080 environment: @@ -22,3 +23,6 @@ services: networks: filepizza: driver: bridge + +volumes: + redis_data: diff --git a/src/hooks/useUploaderChannel.ts b/src/hooks/useUploaderChannel.ts index 5007d03..5f7e8fa 100644 --- a/src/hooks/useUploaderChannel.ts +++ b/src/hooks/useUploaderChannel.ts @@ -6,9 +6,7 @@ function generateURL(slug: string): string { window.location.protocol + '//' + window.location.hostname + - (['80', '443'].includes(window.location.port) - ? '' - : ':' + window.location.port) + (window.location.port ? ':' + window.location.port : '') return `${hostPrefix}/download/${slug}` }