Alright, I removed the NGINX stuff. Not getting the NGINX issues anymore, but I am not able to get my app started and getting a 502 on the site itself.
Here are my logs now:
atl [info] error Command failed with exit code 134.
atl [info] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
atl [info] INFO Main child exited normally with code: 134
atl [info] INFO Starting clean up.
atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
atl [info] [ 12.638506] reboot: Restarting system
atl [info] machine did not have a restart policy, defaulting to restart
atl [info] 2024-08-13T01:20:55.222254862 [01J54N56WN2FBNVVD2PW9WX3MJ:main] Running Firecracker v1.7.0
atl [info] [ 0.277030] PCI: Fatal: No config space access function found
atl [info] INFO Starting init (commit: 20f21dc5f)...
atl [info] INFO Preparing to run: `docker-entrypoint.sh yarn run start` as root
atl [info] INFO [fly api proxy] listening at /.fly/api
atl [info] 2024/08/13 01:20:55 INFO SSH listening listen_address=[fdaa:3:bd7f:a7b:e4:66da:bd42:2]:22 dns_server=[fdaa::3]:53
atl [info] Machine started in 804ms
atl [error] [PC01] instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
atl [error] [PC01] instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
atl [info] yarn run v1.22.19
atl [info] $ ts-node -P tsconfig.server.json server/index.ts
atl [error] [PC01] instance refused connection. is your app listening on 0.0.0.0:8080? make sure it is not only listening on 127.0.0.1 (hint: look at your startup logs, servers often print the address they are listening on)
atl [info] <--- Last few GCs --->
atl [info] [349:0x65e59a0] 10697 ms: Mark-Compact (reduce) 483.4 (492.1) -> 482.4 (492.3) MB, 361.13 / 0.00 ms (+ 39.9 ms in 11 steps since start of marking, biggest step 17.1 ms, walltime since start of marking 440 ms) (average mu = 0.205, current mu = 0.103) a[349:0x65e59a0] 11205 ms: Mark-Compact (reduce) 483.3 (492.3) -> 482.9 (492.8) MB, 352.61 / 0.00 ms (+ 63.3 ms in 15 steps since start of marking, biggest step 21.1 ms, walltime since start of marking 436 ms) (average mu = 0.193, current mu = 0.181) a
atl [info] <--- JS stacktrace --->
atl [info] FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
atl [info] 1: 0xc99970 node::Abort() [/usr/local/bin/node]
atl [info] 2: 0xb6ffcb [/usr/local/bin/node]
atl [info] 3: 0xebe9f0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
atl [info] 4: 0xebecd7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/usr/local/bin/node]
atl [info] 5: 0x10d0785 [/usr/local/bin/node]
atl [info] 6: 0x10d0d14 v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/usr/local/bin/node]
atl [info] 7: 0x10e7c04 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::internal::GarbageCollectionReason, char const*) [/usr/local/bin/node]
atl [info] 8: 0x10e841c v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/usr/local/bin/node]
atl [info] 9: 0x10be721 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
atl [info] 10: 0x10bf8b5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/usr/local/bin/node]
atl [info] 11: 0x109ce26 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/usr/local/bin/node]
atl [info] 12: 0x14f7c56 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/usr/local/bin/node]
atl [info] 13: 0x1931ef6 [/usr/local/bin/node]
atl [info] Aborted
atl [info] error Command failed with exit code 134.
atl [info] info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
atl [info] INFO Main child exited normally with code: 134
atl [info] INFO Starting clean up.
atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
atl [info] [ 13.620904] reboot: Restarting system
atl [info] machine did not have a restart policy, defaulting to restart
atl [info] Starting machine
atl [error] [PM07] failed to change machine state: machine still active, refusing to start
atl [info] 2024-08-13T01:21:07.143089584 [01J54N4NSDBKW8H0R7Q06ZJA1P:main] Running Firecracker v1.7.0
My updated docker file:
# syntax = docker/dockerfile:1
# Adjust NODE_VERSION as desired
ARG NODE_VERSION=20.9.0
FROM node:${NODE_VERSION}-slim as base
LABEL fly_launch_runtime="Vite"
# Vite app lives here
WORKDIR /app
# Set production environment
ENV NODE_ENV="production"
ARG YARN_VERSION=1.22.17
RUN npm install -g yarn@$YARN_VERSION --force
# Install packages needed to build node modules
RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3
# Install node modules
COPY --link package.json yarn.lock ./
RUN yarn install --frozen-lockfile --production=false
# Copy application code
COPY --link . .
# Build application
RUN yarn run build
# Remove development dependencies
RUN yarn install --production=true
# Remove unnecessary files
RUN rm -rf node_modules && yarn install --production=true && rm -rf /root/.cache
# Final image
FROM node:${NODE_VERSION}-slim as final
WORKDIR /app
COPY --from=base /app /app
EXPOSE 8080
CMD [ "yarn", "run", "start" ]