rhh4x0R
rhh4x0R
Explore posts from servers
RRailway
Created by rhh4x0R on 10/24/2024 in #✋|help
Node-Gyp Error Docker React App
Hey y'all, I'm trying to build a react app but I'm not able to install node-gyp for some reason. I saw there's responses about using Nix, but I'd rather use Docker. I've tried a bunch of different apk scripts but still no luck. I've also tried using different node versions, any ideas? Dockerfile:
FROM node:lts-alpine3.17 AS builder

# Install dependencies including Python
RUN apk add --no-cache python3 py3-pip make g++ \
&& ln -sf python3 /usr/bin/python \
&& ln -sf pip3 /usr/bin/pip

# set the working directory
WORKDIR /app

# copy the package.json and package-lock.json files
COPY package.json .
COPY package-lock.json .

# install the dependencies
RUN npm ci

# copy the rest of the files
COPY . .

# build the app
RUN npm run build

# set the command to run the app
CMD ["npm", "run", "start"]
FROM node:lts-alpine3.17 AS builder

# Install dependencies including Python
RUN apk add --no-cache python3 py3-pip make g++ \
&& ln -sf python3 /usr/bin/python \
&& ln -sf pip3 /usr/bin/pip

# set the working directory
WORKDIR /app

# copy the package.json and package-lock.json files
COPY package.json .
COPY package-lock.json .

# install the dependencies
RUN npm ci

# copy the rest of the files
COPY . .

# build the app
RUN npm run build

# set the command to run the app
CMD ["npm", "run", "start"]
Error
#10 44.93 npm ERR! code 1

#10 44.93 npm ERR! path /app/node_modules/usb

#10 44.93 npm ERR! command failed

#10 44.93 npm ERR! command sh -c node-gyp-build

#10 44.93 npm ERR! make: Entering directory '/app/node_modules/usb/build'

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/core.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/io.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/sync.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/events_posix.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o

#10 44.94 npm ERR! make: Leaving directory '/app/node_modules/usb/build'

#10 44.94 npm ERR! gyp info it worked if it ends with ok

#10 44.94 npm ERR! gyp info using [email protected]

#10 44.94 npm ERR! gyp info using [email protected] | linux | x64

#10 44.94 npm ERR! gyp info find Python using Python version 3.10.15 found at "/usr/bin/python3"

#10 44.94 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz

#10 44.94 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz

#10 44.94 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.10.0/SHASUMS256.txt

#10 44.94 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.10.0/SHASUMS256.txt
#10 44.93 npm ERR! code 1

#10 44.93 npm ERR! path /app/node_modules/usb

#10 44.93 npm ERR! command failed

#10 44.93 npm ERR! command sh -c node-gyp-build

#10 44.93 npm ERR! make: Entering directory '/app/node_modules/usb/build'

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/core.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/descriptor.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/hotplug.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/io.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/strerror.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/sync.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/events_posix.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/threads_posix.o

#10 44.93 npm ERR! CC(target) Release/obj.target/libusb/libusb/libusb/os/linux_usbfs.o

#10 44.94 npm ERR! make: Leaving directory '/app/node_modules/usb/build'

#10 44.94 npm ERR! gyp info it worked if it ends with ok

#10 44.94 npm ERR! gyp info using [email protected]

#10 44.94 npm ERR! gyp info using [email protected] | linux | x64

#10 44.94 npm ERR! gyp info find Python using Python version 3.10.15 found at "/usr/bin/python3"

#10 44.94 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz

#10 44.94 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.10.0/node-v20.10.0-headers.tar.gz

#10 44.94 npm ERR! gyp http GET https://unofficial-builds.nodejs.org/download/release/v20.10.0/SHASUMS256.txt

#10 44.94 npm ERR! gyp http 200 https://unofficial-builds.nodejs.org/download/release/v20.10.0/SHASUMS256.txt
16 replies
RRailway
Created by rhh4x0R on 4/24/2024 in #✋|help
ENV Vars Not Accessible On Deployment
Attempting to deploy Astro app via Railway and seems like no ENV vars are being exposed. Dockerfile as requested by @Brody
FROM node:18.16 AS base
WORKDIR /app

COPY package.json package-lock.json ./

FROM base AS build
RUN npm ci

COPY . .
RUN npm run build

FROM base AS runtime

COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist

# Move the drizzle directory to the runtime image
COPY --from=build /app/drizzle ./drizzle

# Create the data directory for the database
RUN mkdir -p /data

ENV HOST=0.0.0.0
ENV PORT=4321
ENV NODE_ENV=production
EXPOSE 4321

CMD node ./dist/server/entry.mjs
FROM node:18.16 AS base
WORKDIR /app

COPY package.json package-lock.json ./

FROM base AS build
RUN npm ci

COPY . .
RUN npm run build

FROM base AS runtime

COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist

# Move the drizzle directory to the runtime image
COPY --from=build /app/drizzle ./drizzle

# Create the data directory for the database
RUN mkdir -p /data

ENV HOST=0.0.0.0
ENV PORT=4321
ENV NODE_ENV=production
EXPOSE 4321

CMD node ./dist/server/entry.mjs
52 replies
RRailway
Created by rhh4x0R on 12/7/2023 in #✋|help
API Crashes with No Logs
Hey y'all, I've got a golang API (Fiber) that I've launched in Railway. Everything seems to be working fine, however after a few hours the app crashes and doesn't restart. There's nothing in the logs that shows when it crashes. Restart Policy is to restart on failure (10 max-retries) but that doesn't seem to be happening either. Any ideas? Project ID: 34f75a65-aa33-477d-a9a7-086c5c19edf4
11 replies