Skip to content

Commit

Permalink
Allow URL override, optimize docker image (#486)
Browse files Browse the repository at this point in the history
* Allow URL override, optimize docker image

Remove unused gulp

* Re-enable UPX
  • Loading branch information
dhvcc authored Jan 11, 2025
1 parent 0c8d855 commit 31701a4
Show file tree
Hide file tree
Showing 5 changed files with 2,145 additions and 3,209 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
web/node_modules
web/build
web/dist
web/.env_example
23 changes: 18 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down
18 changes: 0 additions & 18 deletions web/gulpfile.js

This file was deleted.

4 changes: 0 additions & 4 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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": "",
Expand Down
Loading

0 comments on commit 31701a4

Please sign in to comment.