fix: dockerfile issue

This commit is contained in:
Nicolas Meienberger 2022-10-07 23:35:48 +02:00
parent 8d15b0c29f
commit c67d92bdec
12 changed files with 18 additions and 16 deletions

View file

@ -40,6 +40,8 @@ COPY ./packages/dashboard/package*.json /dashboard/
RUN npm install --omit=dev
COPY --from=build /api/dist /api/dist
COPY --from=build /dashboard/.next /dashboard/.next
COPY ./packages/dashboard /dashboard
WORKDIR /

View file

@ -51,11 +51,12 @@ services:
ports:
- 3001:3001
volumes:
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/apps:/runtipi/apps
- ${PWD}/state:/runtipi/state
- ${PWD}/packages/system-api/src:/api/src
- ${STORAGE_PATH}:/app/storage
- ${PWD}/logs:/app/logs
- ${PWD}/.env.dev:/runtipi/.env
# - /api/node_modules
environment:

View file

@ -44,8 +44,8 @@ services:
tipi-db:
condition: service_healthy
volumes:
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/apps:/runtipi/apps
- ${PWD}/state:/runtipi/state
- ${PWD}/logs:/app/logs
- ${STORAGE_PATH}:/app/storage

View file

@ -44,8 +44,8 @@ services:
tipi-db:
condition: service_healthy
volumes:
- ${PWD}/apps:/runtipi/apps:ro
- ${PWD}/repos:/runtipi/repos:ro
- ${PWD}/apps:/runtipi/apps
- ${PWD}/state:/runtipi/state
- ${PWD}/logs:/app/logs
- ${STORAGE_PATH}:/app/storage

View file

@ -52,7 +52,6 @@ export default function useCachedResources(): IReturnProps {
useEffect(() => {
if (baseUrl) {
console.log('loadResourcesAndDataAsync', baseUrl);
loadResourcesAndDataAsync(baseUrl);
}
}, [baseUrl]);

View file

@ -9,12 +9,13 @@ import { ApolloProvider } from '@apollo/client';
import useCachedResources from '../hooks/useCachedRessources';
import Head from 'next/head';
import StatusWrapper from '../components/StatusScreens/StatusWrapper';
import LoadingScreen from '../components/LoadingScreen';
function MyApp({ Component, pageProps }: AppProps) {
const { client } = useCachedResources();
if (!client) {
return <div>loading...</div>;
return <LoadingScreen />;
}
return (

View file

@ -3,7 +3,5 @@ export default function getEnv(_: any, res: any) {
const { NGINX_PORT } = process.env;
const { DOMAIN } = process.env;
console.log('getenv.tsx: ', INTERNAL_IP, NGINX_PORT, DOMAIN);
res.status(200).json({ ip: INTERNAL_IP, domain: DOMAIN, port: NGINX_PORT });
}

View file

@ -4,9 +4,6 @@ import Layout from '../components/Layout';
import { useLogoutMutation, useRestartMutation, useUpdateMutation, useVersionQuery } from '../generated/graphql';
import { useRef, useState } from 'react';
// Necessary to avoid flickering when initiating an update or restart
const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
const Settings: NextPage = () => {
const toast = useToast();
const restartDisclosure = useDisclosure();
@ -55,7 +52,6 @@ const Settings: NextPage = () => {
setLoading(true);
try {
restart();
await wait(2000);
logout();
} catch (error) {
handleError(error);
@ -68,7 +64,6 @@ const Settings: NextPage = () => {
setLoading(true);
try {
update();
await wait(2000);
logout();
} catch (error) {
handleError(error);

View file

@ -16,7 +16,7 @@ describe('Test: getConfig', () => {
expect(config).toBeDefined();
expect(config.NODE_ENV).toBe('test');
expect(config.logs.LOGS_FOLDER).toBe('logs');
expect(config.logs.LOGS_FOLDER).toBe('/app/logs');
expect(config.logs.LOGS_APP).toBe('app.log');
expect(config.logs.LOGS_ERROR).toBe('error.log');
expect(config.dnsIp).toBe('9.9.9.9');

View file

@ -60,9 +60,9 @@ const main = async () => {
const port = 3001;
app.use(express.static(`${getConfig().rootFolder}/repos/${getConfig().appsRepoId}`));
app.use('/status', systemController.status);
app.use(cors(corsOptions));
app.use(getSessionMiddleware());
app.use('/status', systemController.status);
await datasource.initialize();

View file

@ -13,7 +13,7 @@ fi
# Restart Tipi
if [[ "$command" = "restart" ]]; then
echo "Restarting Tipi..."
write_log "Restarting Tipi..."
scripts/stop.sh
scripts/start.sh
@ -23,6 +23,8 @@ fi
# Update Tipi
if [[ "$command" = "update" ]]; then
write_log "Updating Tipi..."
scripts/stop.sh
git config --global --add safe.directory "${ROOT_FOLDER}"
git pull origin master

View file

@ -17,7 +17,11 @@ function set_status() {
write_log "Setting status for ${id} to ${status}"
# Update the status of the event
sed -i "s/${id}.*$/$(echo "${id} ${status}" | sed 's/\//\\\//g')/" "$WATCH_FILE"
if [[ "$(uname)" != "Linux" ]]; then
sed -i '' "s/${id} [a-z]*/${id} ${status}/g" "${WATCH_FILE}"
else
sed -i "s/${id}.*$/$(echo "${id} ${status}" | sed 's/\//\\\//g')/" "$WATCH_FILE"
fi
}
function run_command() {