-
I have a Dockerized Svelte application that runs perfectly on my local machine, but I’m having trouble deploying it on AWS Lightsail. Here’s what I’ve done so far: ErrorLog
Lightsail Container settings
DockerfileFROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm ci
COPY . .
RUN npm run build
RUN npm prune --production
FROM node:18-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY package.json .
EXPOSE 3000 # <--- I thought this would work
ENV NODE_ENV=production
CMD [ "node", "build" ] Docker Desktop setupWhen I run docker image on local machine, it will work without any issue. I can access it from Docker Desktop uses tcp, so i thought that was a reason why i had this issue, but I am not able to add UpdateI tested out with sveltekit app without any code modification (Skelton project). With Sveltkit dockerfile setup reference. So, i didn't have any env variable set on Lightsail. Has anyone encountered the same error? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
It made Docker image on Macbook, and this happened but not on my Linux. Basically caused by the differnce on architecute when you create Docker Image. Mac: |
Beta Was this translation helpful? Give feedback.
It made Docker image on Macbook, and this happened but not on my Linux.
Basically caused by the differnce on architecute when you create Docker Image. Mac:
ARM64
, Linux:x86_64
. Lightsail is based onx86_64