mirror of https://github.com/lissy93/dashy
fix: update dockerfile
This commit is contained in:
parent
1ac4e8014f
commit
1d526b73e9
17
Dockerfile
17
Dockerfile
|
@ -1,13 +1,8 @@
|
||||||
FROM node:14.17-alpine AS BUILD_IMAGE
|
FROM node:14.17.5-alpine AS BUILD_IMAGE
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||||
|
|
||||||
# Define some ENV Vars
|
|
||||||
ENV PORT=80 \
|
|
||||||
DIRECTORY=/app \
|
|
||||||
IS_DOCKER=true
|
|
||||||
|
|
||||||
# Install additional tools needed on arm64 and armv7
|
# Install additional tools needed on arm64 and armv7
|
||||||
RUN \
|
RUN \
|
||||||
case "${TARGETPLATFORM}" in \
|
case "${TARGETPLATFORM}" in \
|
||||||
|
@ -16,7 +11,7 @@ RUN \
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Create and set the working directory
|
# Create and set the working directory
|
||||||
WORKDIR ${DIRECTORY}
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install --frozen-lockfile --network-timeout 1000000
|
RUN yarn install --frozen-lockfile --network-timeout 1000000
|
||||||
|
@ -27,11 +22,11 @@ COPY . ./
|
||||||
# Build initial app for production
|
# Build initial app for production
|
||||||
RUN yarn build
|
RUN yarn build
|
||||||
|
|
||||||
# remove development dependencies
|
# # remove development dependencies
|
||||||
RUN yarn install --production --ignore-scripts --prefer-offline
|
# RUN yarn install --production --ignore-scripts --prefer-offline
|
||||||
|
|
||||||
# Build the final image
|
# Build the final image
|
||||||
FROM node:14.17-alpine
|
FROM node:14.17.5-alpine
|
||||||
|
|
||||||
# Define some ENV Vars
|
# Define some ENV Vars
|
||||||
ENV PORT=80 \
|
ENV PORT=80 \
|
||||||
|
@ -49,7 +44,7 @@ COPY --from=BUILD_IMAGE /app ./
|
||||||
|
|
||||||
# Finally, run start command to serve up the built application
|
# Finally, run start command to serve up the built application
|
||||||
ENTRYPOINT [ "/sbin/tini", "--" ]
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
||||||
CMD [ "yarn", "start" ]
|
CMD [ "yarn", "build-and-start" ]
|
||||||
|
|
||||||
# Expose given port
|
# Expose given port
|
||||||
EXPOSE ${PORT}
|
EXPOSE ${PORT}
|
||||||
|
|
Loading…
Reference in New Issue