dashy/Dockerfile

32 lines
769 B
Docker
Raw Normal View History

FROM node:lts-alpine3.14
# Define some ENV Vars
2021-08-07 14:35:45 +00:00
ENV PORT=80 \
DIRECTORY=/app \
IS_DOCKER=true
# Create and set the working directory
WORKDIR ${DIRECTORY}
# Copy over both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
2021-08-09 10:47:27 +00:00
COPY yarn.lock ./
2021-06-03 20:40:34 +00:00
# Install project dependencies
RUN yarn
# Copy over all project files and folders to the working directory
COPY . .
# Build initial app for production
RUN yarn build
# Expose given port
EXPOSE ${PORT}
# Finally, run start command to serve up the built application
CMD [ "yarn", "build-and-start"]
# Run simple healthchecks every 5 mins, to check the Dashy's everythings great
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check