mirror of
https://github.com/Ernous/TorrServerJellyfin.git
synced 2025-12-15 20:06:10 +05:00
Allow URL override, optimize docker image (#486)
* Allow URL override, optimize docker image Remove unused gulp * Re-enable UPX
This commit is contained in:
4
.dockerignore
Normal file
4
.dockerignore
Normal file
@@ -0,0 +1,4 @@
|
||||
web/node_modules
|
||||
web/build
|
||||
web/dist
|
||||
web/.env_example
|
||||
23
Dockerfile
23
Dockerfile
@@ -1,14 +1,27 @@
|
||||
### FRONT BUILD START ###
|
||||
FROM --platform=$BUILDPLATFORM node:16-alpine as front
|
||||
COPY ./web /app
|
||||
FROM --platform=$BUILDPLATFORM node:16-alpine AS front
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG REACT_APP_SERVER_HOST=
|
||||
ARG REACT_APP_TMDB_API_KEY=
|
||||
ARG PUBLIC_URL=
|
||||
|
||||
ENV REACT_APP_SERVER_HOST=$REACT_APP_SERVER_HOST
|
||||
ENV REACT_APP_TMDB_API_KEY=$REACT_APP_TMDB_API_KEY
|
||||
ENV PUBLIC_URL=$PUBLIC_URL
|
||||
|
||||
COPY ./web/package.json .
|
||||
RUN yarn install
|
||||
|
||||
# Build front once upon multiarch build
|
||||
RUN yarn install && yarn run build
|
||||
COPY ./web .
|
||||
RUN yarn run build
|
||||
### FRONT BUILD END ###
|
||||
|
||||
|
||||
### BUILD TORRSERVER MULTIARCH START ###
|
||||
FROM --platform=$BUILDPLATFORM golang:1.21.2-alpine as builder
|
||||
FROM --platform=$BUILDPLATFORM golang:1.21.2-alpine AS builder
|
||||
|
||||
COPY . /opt/src
|
||||
COPY --from=front /app/build /opt/src/web/build
|
||||
@@ -31,7 +44,7 @@ RUN apk add --update g++ \
|
||||
|
||||
|
||||
### UPX COMPRESSING START ###
|
||||
FROM debian:buster-slim as compressed
|
||||
FROM debian:buster-slim AS compressed
|
||||
|
||||
COPY --from=builder /opt/src/server/torrserver ./torrserver
|
||||
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
/* eslint-disable import/no-extraneous-dependencies */
|
||||
const gulp = require('gulp')
|
||||
const inlinesource = require('gulp-inline-source')
|
||||
const replace = require('gulp-replace')
|
||||
|
||||
gulp.task('default', () =>
|
||||
gulp
|
||||
.src('./build/*.html')
|
||||
.pipe(replace('.js"></script>', '.js" inline></script>'))
|
||||
.pipe(replace('rel="stylesheet">', 'rel="stylesheet" inline>'))
|
||||
.pipe(
|
||||
inlinesource({
|
||||
compress: false,
|
||||
ignore: ['png'],
|
||||
}),
|
||||
)
|
||||
.pipe(gulp.dest('./dest')),
|
||||
)
|
||||
@@ -30,7 +30,6 @@
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"build-js": "yarn run build && npx gulp",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject",
|
||||
"lint": "eslint --ext .js,.jsx src --color",
|
||||
@@ -60,9 +59,6 @@
|
||||
"eslint-config-airbnb": "^18.2.1",
|
||||
"eslint-config-prettier": "^8.10.0",
|
||||
"eslint-plugin-prettier": "^3.4.0",
|
||||
"gulp": "^4.0.2",
|
||||
"gulp-inline-source": "^4.0.0",
|
||||
"gulp-replace": "^1.1.4",
|
||||
"prettier": "^2.8.8"
|
||||
},
|
||||
"description": "",
|
||||
|
||||
5281
web/yarn.lock
5281
web/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user