Skip to content

Commit

Permalink
improve docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
edde746 committed Dec 4, 2023
1 parent e823664 commit a3cf12c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 46 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
screenshots/*
screenshots*
/node_modules
/build
/yarn.lock
/npm-debug.log
.DS_Store
.prettierignore
35 changes: 12 additions & 23 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
# Stremio Node 14.x
# the node version for running Stremio Web
ARG NODE_VERSION=15-alpine
FROM node:$NODE_VERSION AS base
FROM node:alpine AS build
WORKDIR /web

# Meta
LABEL Description="Stremio Web" Vendor="Smart Code OOD" Version="1.0.0"

RUN mkdir -p /var/www/stremio-web
WORKDIR /var/www/stremio-web
RUN apk add --no-cache git

# Install app dependencies
FROM base AS prebuild

RUN apk update && apk upgrade && \
apk add --no-cache git
WORKDIR /var/www/stremio-web
COPY . .
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN npm run build
RUN echo '{"configs":[{"path":"*","fileExtension":"*","headers":[{"key":"cache-control","value":"public, max-age=7200"}]}]}' >> headerConfig.json

# Bundle app source
FROM base AS final
FROM pierrezemb/gostatic:latest

WORKDIR /var/www/stremio-web
COPY . .
COPY --from=prebuild /var/www/stremio-web/node_modules ./node_modules
COPY --from=prebuild /var/www/stremio-web/build ./build
LABEL Description="Stremio Web" Vendor="Smart Code OOD" Version="1.0.0"

COPY --from=build /web/build/ /srv/http
COPY --from=build /web/headerConfig.json /config/

EXPOSE 8080
CMD ["node", "http_server.js"]
ENTRYPOINT ["/goStatic","-port","8080","-path","/srv/http","-fallback","/index.html"]
23 changes: 0 additions & 23 deletions http_server.js

This file was deleted.

0 comments on commit a3cf12c

Please sign in to comment.