diff --git a/.github/workflows/container-dev.yml b/.github/workflows/container-dev.yml index 9f66770f..fd73487c 100644 --- a/.github/workflows/container-dev.yml +++ b/.github/workflows/container-dev.yml @@ -1,4 +1,4 @@ -name: Development Watcharr Container Release +name: Development Watcharr Image Release on: workflow_dispatch: diff --git a/.github/workflows/container-release.yml b/.github/workflows/container-release.yml index 0c7f2215..784eaa50 100644 --- a/.github/workflows/container-release.yml +++ b/.github/workflows/container-release.yml @@ -1,7 +1,6 @@ -name: Release Watcharr Containers +name: Release Watcharr Image on: - workflow_dispatch: push: tags: - v* diff --git a/Dockerfile b/Dockerfile index 7b31d9ae..3dc5c9f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,16 @@ # Backend -FROM golang:1.21 AS server +FROM golang:1.21-alpine AS server WORKDIR /server COPY server/*.go server/go.* ./ -RUN go mod download && GOOS=linux go build -o ./watcharr +# Required so we can build with cgo +RUN apk update && apk add --no-cache musl-dev gcc build-base + +RUN go mod download && GOOS=linux CGO_ENABLED=1 go build -o ./watcharr # Frontend -FROM node:19 AS ui +FROM node:20-alpine AS ui WORKDIR /app COPY package*.json vite.config.ts svelte.config.js tsconfig.json ./ @@ -17,24 +20,12 @@ COPY ./static ./static RUN npm install && npm run build # Production -FROM debian:12.0 AS runner - -RUN apt-get update && apt-get install ca-certificates -y - -ENV NODE_VERSION=18.13.0 -RUN apt install -y curl -RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash -ENV NVM_DIR=/root/.nvm -RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} -RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} -ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" -RUN node --version +FROM node:20-alpine AS runner COPY --from=server /server/watcharr / COPY --from=ui /app/build /ui COPY --from=ui /app/package.json /app/package-lock.json /ui -RUN cd /ui && npm ci +RUN cd /ui && npm ci --omit=dev EXPOSE 3080 diff --git a/package-lock.json b/package-lock.json index b4b1a9a1..4afd94d1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "watcharr", - "version": "1.21.0", + "version": "1.21.1-dev", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "watcharr", - "version": "1.21.0", + "version": "1.21.1-dev", "dependencies": { "axios": "^1.6.0" }, diff --git a/package.json b/package.json index c5ab2d56..086894c7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "watcharr", - "version": "1.21.0", + "version": "1.21.1-dev", "private": true, "scripts": { "dev": "vite dev",