klitchevo
klitchevo
Explore posts from servers
RRailway
Created by klitchevo on 11/10/2024 in #✋|help
Update php.ini when using Wordpress image
As title says, I need to update php.ini to these values: RUN echo "upload_max_filesize = 128M" >> /usr/local/etc/php/php.ini RUN echo "post_max_size = 128M" >> /usr/local/etc/php/php.ini RUN echo "max_execution_time = 300" >> /usr/local/etc/php/php.ini RUN echo "max_input_time = 300" >> /usr/local/etc/php/php.ini How can I do this? I am using wordpress image, I do not have any code on local machine
6 replies
RRailway
Created by klitchevo on 8/4/2024 in #✋|help
Nginx won't redirect to index.html
I have a react project that I am deploying to railway. When I access its root route, it works fine, but whenever I try to go to for example /profile and refresh page I get 404. Here is my nginx config
events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

location / {
try_files '' /index.html =404;
}

# Cache control for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
add_header Cache-Control "public, max-age=31536000";
}

# Error page
error_page 404 /index.html;
}
}
events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;

server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html;

location / {
try_files '' /index.html =404;
}

# Cache control for static assets
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
add_header Cache-Control "public, max-age=31536000";
}

# Error page
error_page 404 /index.html;
}
}
and here is my Dockerfile:
# Stage 1: Build the Vite application
FROM node:18-alpine AS builder

# Set working directory
WORKDIR /app

# Install pnpm globally
RUN npm install -g pnpm

# Copy package.json and pnpm-lock.yaml
COPY package.json pnpm-lock.yaml ./

# Install dependencies
RUN pnpm install

# Copy the rest of the application code
COPY . .

# Build the application
RUN pnpm run build

# Stage 2: Serve the application using Nginx
FROM nginx:alpine

# Copy the built application from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html

# Copy the Nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
# Stage 1: Build the Vite application
FROM node:18-alpine AS builder

# Set working directory
WORKDIR /app

# Install pnpm globally
RUN npm install -g pnpm

# Copy package.json and pnpm-lock.yaml
COPY package.json pnpm-lock.yaml ./

# Install dependencies
RUN pnpm install

# Copy the rest of the application code
COPY . .

# Build the application
RUN pnpm run build

# Stage 2: Serve the application using Nginx
FROM nginx:alpine

# Copy the built application from the builder stage
COPY --from=builder /app/dist /usr/share/nginx/html

# Copy the Nginx configuration file
COPY nginx.conf /etc/nginx/nginx.conf

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
any ideas? Also is it worth exploring caddy for this use case maybe?
20 replies
TtRPC
Created by klitchevo on 7/25/2024 in #❓-help
Issue creating server - v11
I have nest.js app and I am running tRPC inside of it, however when I want to instantiate router I get typescript errors: private readonly trpc = initTRPC.context<ContextType>().create(); middleware = this.trpc.middleware; procedure = this.trpc.procedure; router = this.trpc.router; In my other file I have appRouter = this.trpc.router({ hello: this.trpc.procedure.query(() => { return { message: "Hello, World!" }; }), }); also app.use( /trpc, trpcExpress.createExpressMiddleware({ router: this.appRouter, }), ); I get error like this: TS2322: Type CreateRouterInner<RootConfig<{ ctx: { authenticated: boolean; req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }; meta: object; errorShape: never; transformer: DataTransformerOptions; }>, { ...; }> is not assignable to type AnyRouter Types of property _def are incompatible. Type 'RouterDef<RootConfig<{ ctx: { authenticated: boolean; req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }; meta: object; errorShape: never; transformer: DataTransformerOptions; }>, { ...; }, { ...; }>' is not assignable to type 'AnyRouterDef<AnyRootConfig, any>'. Type 'RootConfig<{ ctx: { authenticated: boolean; req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>; res: Response<any, Record<string, any>>; }; meta: object; errorShape: never; transformer: DataTransformerOptions; }>' is not assignable to type 'AnyRootConfig'. Type any is not assignable to type never Any ideas? Thanks in advance!
2 replies