make Dockerfile simpler

This commit is contained in:
Cat /dev/Nulo 2023-03-20 21:44:25 -03:00
parent 3acefb8675
commit f864e52aa3

View file

@ -1,14 +1,6 @@
FROM debian:bullseye as builder FROM alpine:3.17 as builder
ARG NODE_VERSION=19.7.0 RUN apk add --no-cache nodejs-current npm
RUN apt-get update; apt install -y curl
RUN curl https://get.volta.sh | bash
ENV VOLTA_HOME /root/.volta
ENV PATH /root/.volta/bin:$PATH
RUN volta install node@${NODE_VERSION}
#######################################################################
RUN mkdir /app RUN mkdir /app
WORKDIR /app WORKDIR /app
@ -22,16 +14,16 @@ ENV NODE_ENV production
COPY . . COPY . .
RUN npm install RUN npm install
FROM debian:bullseye
FROM alpine:3.17
RUN apk add --no-cache nodejs-current npm
LABEL fly_launch_runtime="nodejs" LABEL fly_launch_runtime="nodejs"
COPY --from=builder /root/.volta /root/.volta
COPY --from=builder /app /app COPY --from=builder /app /app
WORKDIR /app WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
ENV PATH /root/.volta/bin:$PATH
ENV PORT 8080 ENV PORT 8080
CMD [ "npm", "run", "start" ] CMD [ "npm", "run", "start" ]