thunderhub/arm64v8.Dockerfile

60 lines
1.1 KiB
Text
Raw Normal View History

2020-05-19 16:38:18 +02:00
# ---------------
# Install Dependencies
2020-05-19 16:38:18 +02:00
# ---------------
2020-12-16 13:52:59 +01:00
FROM arm64v8/node:14.15-alpine as deps
WORKDIR /app
# Install dependencies neccesary for node-gyp on node alpine
2020-05-19 16:38:18 +02:00
RUN apk add --update --no-cache \
2020-12-16 13:52:59 +01:00
libc6-compat \
2020-05-19 16:38:18 +02:00
python \
make \
g++
2020-12-16 13:52:59 +01:00
# Install app dependencies
2020-12-16 13:52:59 +01:00
COPY package.json package-lock.json ./
RUN npm install
# ---------------
# Build App
# ---------------
FROM deps as build
WORKDIR /app
# Set env variables
ARG BASE_PATH=""
ENV BASE_PATH=${BASE_PATH}
ENV NEXT_TELEMETRY_DISABLED=1
2020-08-09 16:03:18 +02:00
# Build the NextJS application
COPY . .
RUN npm run build
# Remove non production necessary modules
RUN npm prune --production
2020-05-12 12:16:44 +02:00
# ---------------
2020-12-16 13:52:59 +01:00
# Release App
# ---------------
2020-11-19 22:56:39 +01:00
FROM arm64v8/node:14.15-alpine
WORKDIR /app
2020-12-16 13:52:59 +01:00
# Set env variables
ARG BASE_PATH=""
ENV BASE_PATH=${BASE_PATH}
ENV NEXT_TELEMETRY_DISABLED=1
2020-12-16 13:52:59 +01:00
COPY --from=build /app/package.json /app/package-lock.json /app/next.config.js ./
COPY --from=build /app/public ./public
COPY --from=build /app/node_modules/ ./node_modules
COPY --from=build /app/.next/ ./.next
COPY ./scripts/initCookie.sh ./scripts/initCookie.sh
EXPOSE 3000
2020-05-12 12:16:44 +02:00
CMD [ "npm", "start" ]