mirror of
https://github.com/a-sync/game-server-watcher.git
synced 2026-03-31 06:24:19 -04:00
switch to official node image
* split up install steps to take advantage of cache layers
This commit is contained in:
29
Dockerfile
29
Dockerfile
@@ -1,34 +1,23 @@
|
||||
FROM debian:bullseye as builder
|
||||
|
||||
ARG NODE_VERSION=16.15.1
|
||||
|
||||
RUN apt-get update; apt install -y curl python-is-python3 pkg-config build-essential
|
||||
RUN curl https://get.volta.sh | bash
|
||||
ENV VOLTA_HOME /root/.volta
|
||||
ENV PATH /root/.volta/bin:$PATH
|
||||
RUN volta install node@${NODE_VERSION}
|
||||
|
||||
#######################################################################
|
||||
FROM node:18 as builder
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm install
|
||||
|
||||
RUN npm install --production=false && npm run build
|
||||
RUN rm -rf node_modules && npm install --production=true
|
||||
COPY . .
|
||||
RUN npm run build && rm -rf node_modules
|
||||
|
||||
#######################################################################
|
||||
|
||||
FROM debian:bullseye
|
||||
|
||||
FROM node:18
|
||||
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
|
||||
|
||||
COPY --from=builder /app /app
|
||||
RUN npm install
|
||||
|
||||
CMD [ "npm", "run", "start" ]
|
||||
|
||||
Reference in New Issue
Block a user