mirror of
https://github.com/meienberger/runtipi.git
synced 2024-08-16 23:50:34 +03:00
chore: revert stuff
chore: remove worker dockerfiles
This commit is contained in:
parent
2681630996
commit
8391874b90
@ -1,8 +1,7 @@
|
||||
-
|
||||
*
|
||||
|
||||
### Includes
|
||||
|
||||
!pnpm-_.yaml
|
||||
### Includes ###
|
||||
!pnpm-*.yaml
|
||||
!package.json
|
||||
!patches/**
|
||||
!packages/**/src/**
|
||||
@ -10,10 +9,10 @@
|
||||
!**/package.json
|
||||
!**/nodemon.json
|
||||
!**/tsconfig.json
|
||||
!\*\*/build.js
|
||||
!**/build.js
|
||||
!next.config.mjs
|
||||
!sentry._.config.ts
|
||||
!sentry.*.config.ts
|
||||
!public/**
|
||||
!src/**
|
||||
!tests/\*\*
|
||||
!start.\_.sh
|
||||
!tests/**
|
||||
!start.*.sh
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -70,6 +70,3 @@ temp
|
||||
|
||||
# Sentry Config File
|
||||
.sentryclirc
|
||||
|
||||
# Runtipi data folder
|
||||
/runtipi-data/
|
||||
|
@ -117,6 +117,6 @@ COPY --from=dashboard_builder /dashboard/.next/static ./.next/static
|
||||
WORKDIR /
|
||||
COPY ./start.prod.sh ./start.sh
|
||||
|
||||
EXPOSE 3000 5000
|
||||
EXPOSE 3000 5000 5001
|
||||
|
||||
CMD ["sh", "start.sh"]
|
||||
|
@ -6,8 +6,8 @@ import { execRemoteCommand } from './write-remote-file';
|
||||
|
||||
export const setSettings = async (settings: z.infer<typeof settingsSchema>) => {
|
||||
if (process.env.REMOTE === 'true') {
|
||||
await execRemoteCommand(`mkdir -p ./data/state`);
|
||||
await execRemoteCommand(`echo '${JSON.stringify(settings)}' > ./data/state/settings.json`);
|
||||
await execRemoteCommand(`mkdir -p ./runtipi/state`);
|
||||
await execRemoteCommand(`echo '${JSON.stringify(settings)}' > ./runtipi/state/settings.json`);
|
||||
} else {
|
||||
// Create state folder if it doesn't exist
|
||||
await promises.mkdir('./state', { recursive: true });
|
||||
@ -18,7 +18,7 @@ export const setSettings = async (settings: z.infer<typeof settingsSchema>) => {
|
||||
|
||||
export const setPassowrdChangeRequest = async () => {
|
||||
if (process.env.REMOTE === 'true') {
|
||||
await execRemoteCommand('touch ./data/state/password-change-request');
|
||||
await execRemoteCommand('touch ./runtipi/state/password-change-request');
|
||||
} else {
|
||||
await promises.writeFile('./state/password-change-request', '');
|
||||
}
|
||||
@ -26,7 +26,7 @@ export const setPassowrdChangeRequest = async () => {
|
||||
|
||||
export const unsetPasswordChangeRequest = async () => {
|
||||
if (process.env.REMOTE === 'true') {
|
||||
await execRemoteCommand('rm ./data/state/password-change-request');
|
||||
await execRemoteCommand('rm ./runtipi/state/password-change-request');
|
||||
} else if (await pathExists('./state/password-change-request')) {
|
||||
await promises.unlink('./state/password-change-request');
|
||||
}
|
||||
@ -34,11 +34,11 @@ export const unsetPasswordChangeRequest = async () => {
|
||||
|
||||
export const setWelcomeSeen = async (seen: boolean) => {
|
||||
if (seen && process.env.REMOTE === 'true') {
|
||||
return execRemoteCommand('touch ./data/state/seen-welcome');
|
||||
return execRemoteCommand('touch ./runtipi/state/seen-welcome');
|
||||
}
|
||||
|
||||
if (!seen && process.env.REMOTE === 'true') {
|
||||
return execRemoteCommand('rm ./data/state/seen-welcome');
|
||||
return execRemoteCommand('rm ./runtipi/state/seen-welcome');
|
||||
}
|
||||
|
||||
if (seen && !(await pathExists('./state/seen-welcome'))) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
"start:dev-container": "./.devcontainer/filewatcher.sh && npm run start:dev",
|
||||
"start:rc": "docker compose -f docker-compose.rc.yml --env-file .env up --build",
|
||||
"start:dev": "docker compose -f docker-compose.dev.yml up --build",
|
||||
"start:prod": "docker compose -f docker-compose.prod.yml up --build",
|
||||
"start:prod": "docker compose --env-file ./.env -f docker-compose.prod.yml up --build",
|
||||
"start:pg": "docker run --name test-db -p 5433:5432 -d --rm -e POSTGRES_PASSWORD=postgres postgres:14",
|
||||
"version": "echo $npm_package_version",
|
||||
"release:rc": "./scripts/deploy/release-rc.sh",
|
||||
|
@ -20,7 +20,7 @@ export const envSchema = z.object({
|
||||
appsRepoUrl: z.string().url().trim(),
|
||||
domain: z.string().trim(),
|
||||
localDomain: z.string().trim(),
|
||||
appDataDirPath: z
|
||||
storagePath: z
|
||||
.string()
|
||||
.trim()
|
||||
.optional()
|
||||
@ -97,7 +97,7 @@ export const settingsSchema = envSchema
|
||||
postgresPort: true,
|
||||
appsRepoUrl: true,
|
||||
domain: true,
|
||||
appDataDirPath: true,
|
||||
storagePath: true,
|
||||
localDomain: true,
|
||||
demoMode: true,
|
||||
guestDashboard: true,
|
||||
|
@ -1,76 +0,0 @@
|
||||
ARG NODE_VERSION="20.10"
|
||||
ARG ALPINE_VERSION="3.18"
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS node_base
|
||||
|
||||
# ---- BUILDER BASE ----
|
||||
FROM node_base AS builder_base
|
||||
|
||||
RUN npm install pnpm -g
|
||||
RUN apk add curl
|
||||
|
||||
# ---- RUNNER BASE ----
|
||||
FROM node_base AS runner_base
|
||||
|
||||
RUN apk add curl openssl git && rm -rf /var/cache/apk/*
|
||||
|
||||
ARG NODE_ENV="production"
|
||||
|
||||
# ---- BUILDER ----
|
||||
FROM builder_base AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ARG TARGETARCH
|
||||
ENV TARGETARCH=${TARGETARCH}
|
||||
ARG DOCKER_COMPOSE_VERSION="v2.23.3"
|
||||
|
||||
RUN echo "Building for ${TARGETARCH}"
|
||||
|
||||
|
||||
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
|
||||
curl -L -o docker-binary "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-aarch64"; \
|
||||
elif [ "${TARGETARCH}" = "amd64" ]; then \
|
||||
curl -L -o docker-binary "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-x86_64"; \
|
||||
else \
|
||||
echo "Unsupported architecture"; \
|
||||
fi
|
||||
|
||||
RUN chmod +x docker-binary
|
||||
|
||||
COPY ./pnpm-lock.yaml ./
|
||||
RUN pnpm fetch --ignore-scripts
|
||||
|
||||
COPY ./pnpm-workspace.yaml ./
|
||||
COPY ./packages ./packages
|
||||
|
||||
RUN pnpm install -r --prefer-offline
|
||||
|
||||
COPY ./packages/worker/build.js ./packages/worker/build.js
|
||||
COPY ./packages/worker/src ./packages/worker/src
|
||||
COPY ./packages/worker/package.json ./packages/worker/package.json
|
||||
COPY ./packages/worker/assets ./packages/worker/assets
|
||||
|
||||
ARG SENTRY_AUTH_TOKEN
|
||||
ARG SENTRY_DISABLE_AUTO_UPLOAD
|
||||
ARG TIPI_VERSION
|
||||
|
||||
ENV SENTRY_AUTH_TOKEN=${SENTRY_AUTH_TOKEN}
|
||||
ENV SENTRY_DISABLE_AUTO_UPLOAD=${SENTRY_DISABLE_AUTO_UPLOAD}
|
||||
ENV TIPI_VERSION=${TIPI_VERSION}
|
||||
|
||||
RUN pnpm -r build --filter @runtipi/worker
|
||||
|
||||
# ---- RUNNER ----
|
||||
FROM runner_base AS app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app/packages/worker/dist .
|
||||
COPY --from=builder /app/packages/worker/assets ./assets
|
||||
COPY --from=builder /app/docker-binary /usr/local/bin/docker-compose
|
||||
|
||||
CMD ["node", "index.js", "start"]
|
||||
|
@ -1,45 +0,0 @@
|
||||
ARG NODE_VERSION="20.10"
|
||||
ARG ALPINE_VERSION="3.18"
|
||||
ARG DOCKER_COMPOSE_VERSION="v2.23.3"
|
||||
|
||||
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS node_base
|
||||
|
||||
# Install docker
|
||||
RUN apk upgrade --update-cache --available && \
|
||||
apk add openssl git docker docker-cli-compose curl && \
|
||||
rm -rf /var/cache/apk/*
|
||||
|
||||
ARG TARGETARCH
|
||||
ARG DOCKER_COMPOSE_VERSION="v2.23.3"
|
||||
ENV TARGETARCH=${TARGETARCH}
|
||||
ENV NODE_ENV="development"
|
||||
|
||||
RUN echo "Building for ${TARGETARCH}"
|
||||
|
||||
RUN if [ "${TARGETARCH}" = "arm64" ]; then \
|
||||
curl -L -o docker-binary "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-aarch64"; \
|
||||
elif [ "${TARGETARCH}" = "amd64" ]; then \
|
||||
curl -L -o docker-binary "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-linux-x86_64"; \
|
||||
fi
|
||||
|
||||
RUN chmod +x docker-binary
|
||||
|
||||
RUN mv docker-binary /usr/local/bin/docker-compose
|
||||
|
||||
RUN npm install pnpm -g
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./pnpm-lock.yaml ./
|
||||
COPY ./pnpm-workspace.yaml ./
|
||||
COPY ./patches ./patches
|
||||
RUN pnpm fetch --no-scripts
|
||||
|
||||
COPY ./packages/worker/assets ./assets
|
||||
COPY ./packages ./packages
|
||||
|
||||
RUN pnpm install -r --prefer-offline
|
||||
|
||||
|
||||
CMD ["pnpm", "--filter", "@runtipi/worker", "-r", "dev"]
|
||||
|
@ -62,7 +62,7 @@ export class TipiConfigClass {
|
||||
domain: conf.DOMAIN,
|
||||
localDomain: conf.LOCAL_DOMAIN,
|
||||
dnsIp: conf.DNS_IP || '9.9.9.9',
|
||||
appDataDirPath: conf.APP_DATA_DIR,
|
||||
storagePath: conf.STORAGE_PATH,
|
||||
demoMode: conf.DEMO_MODE,
|
||||
guestDashboard: conf.GUEST_DASHBOARD,
|
||||
allowErrorMonitoring: conf.ALLOW_ERROR_MONITORING,
|
||||
|
Loading…
Reference in New Issue
Block a user