Open nabarunchakma opened 1 month ago
This is to create a Docker file for ExpressJS API. The following can be used as inspiration.
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen". FROM public.ecr.aws/docker/library/node:20.9.0-slim as builder ARG AWS_ACCESS_KEY_ID ARG AWS_SECRET_ACCESS_KEY ARG AWS_SESSION_TOKEN ARG AWS_REGION=ap-southeast-2 RUN apt-get update && \ apt-get install -y python3-launchpadlib software-properties-common && \ add-apt-repository -y ppa:deadsnakes/ppa && \ apt-get update && \ apt-get install -y python3 python3-pip RUN python3 -V && pip3 --version && \ pip3 install awscli --break-system-packages WORKDIR /usr/app COPY . . RUN yarn codeartifact:login RUN yarn install --frozen-lockfile && yarn build && yarn build:esbuild FROM public.ecr.aws/lambda/nodejs:20 as runner EXPOSE 3000 WORKDIR ${LAMBDA_TASK_ROOT} COPY --from=builder /usr/app/dist/* ./ CMD ["index.handler"]
Some reference guide.
https://www.geeksforgeeks.org/how-to-dockerize-an-expressjs-app/
@nabarunchakma da, do you suggest to use projen package for this project?
projen
@ChakmaSajib Projen is complex. I think team is not ready to support projen yet.
This is to create a Docker file for ExpressJS API. The following can be used as inspiration.
Some reference guide.
https://www.geeksforgeeks.org/how-to-dockerize-an-expressjs-app/