make Dockerfile simpler

This commit is contained in:
Cat /dev/Nulo 2023-03-20 21:44:25 -03:00
parent 3acefb8675
commit f864e52aa3
1 changed files with 5 additions and 13 deletions

View File

@ -1,14 +1,6 @@
FROM debian:bullseye as builder
FROM alpine:3.17 as builder
ARG NODE_VERSION=19.7.0
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 apk add --no-cache nodejs-current npm
RUN mkdir /app
WORKDIR /app
@ -22,16 +14,16 @@ ENV NODE_ENV production
COPY . .
RUN npm install
FROM debian:bullseye
FROM alpine:3.17
RUN apk add --no-cache nodejs-current npm
LABEL fly_launch_runtime="nodejs"
COPY --from=builder /root/.volta /root/.volta
COPY --from=builder /app /app
WORKDIR /app
ENV NODE_ENV production
ENV PATH /root/.volta/bin:$PATH
ENV PORT 8080
CMD [ "npm", "run", "start" ]