Skip to content

Commit 31701a4

Browse files
authored
Allow URL override, optimize docker image (#486)
* Allow URL override, optimize docker image Remove unused gulp * Re-enable UPX
1 parent 0c8d855 commit 31701a4

File tree

5 files changed

+2145
-3209
lines changed

5 files changed

+2145
-3209
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
web/node_modules
2+
web/build
3+
web/dist
4+
web/.env_example

Dockerfile

+18-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
### FRONT BUILD START ###
2-
FROM --platform=$BUILDPLATFORM node:16-alpine as front
3-
COPY ./web /app
2+
FROM --platform=$BUILDPLATFORM node:16-alpine AS front
3+
44
WORKDIR /app
5+
6+
ARG REACT_APP_SERVER_HOST=
7+
ARG REACT_APP_TMDB_API_KEY=
8+
ARG PUBLIC_URL=
9+
10+
ENV REACT_APP_SERVER_HOST=$REACT_APP_SERVER_HOST
11+
ENV REACT_APP_TMDB_API_KEY=$REACT_APP_TMDB_API_KEY
12+
ENV PUBLIC_URL=$PUBLIC_URL
13+
14+
COPY ./web/package.json .
15+
RUN yarn install
16+
517
# Build front once upon multiarch build
6-
RUN yarn install && yarn run build
18+
COPY ./web .
19+
RUN yarn run build
720
### FRONT BUILD END ###
821

922

1023
### BUILD TORRSERVER MULTIARCH START ###
11-
FROM --platform=$BUILDPLATFORM golang:1.21.2-alpine as builder
24+
FROM --platform=$BUILDPLATFORM golang:1.21.2-alpine AS builder
1225

1326
COPY . /opt/src
1427
COPY --from=front /app/build /opt/src/web/build
@@ -31,7 +44,7 @@ RUN apk add --update g++ \
3144

3245

3346
### UPX COMPRESSING START ###
34-
FROM debian:buster-slim as compressed
47+
FROM debian:buster-slim AS compressed
3548

3649
COPY --from=builder /opt/src/server/torrserver ./torrserver
3750

web/gulpfile.js

-18
This file was deleted.

web/package.json

-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
"scripts": {
3131
"start": "react-scripts start",
3232
"build": "react-scripts build",
33-
"build-js": "yarn run build && npx gulp",
3433
"test": "react-scripts test",
3534
"eject": "react-scripts eject",
3635
"lint": "eslint --ext .js,.jsx src --color",
@@ -60,9 +59,6 @@
6059
"eslint-config-airbnb": "^18.2.1",
6160
"eslint-config-prettier": "^8.10.0",
6261
"eslint-plugin-prettier": "^3.4.0",
63-
"gulp": "^4.0.2",
64-
"gulp-inline-source": "^4.0.0",
65-
"gulp-replace": "^1.1.4",
6662
"prettier": "^2.8.8"
6763
},
6864
"description": "",

0 commit comments

Comments
 (0)