forked from gchq/CyberChef
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request gchq#160 from Lissy93/DOCKER/revert-image
[DOCKER] Update Dockerfiles Fixes gchq#136
- Loading branch information
Showing
8 changed files
with
103 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,31 @@ | ||
FROM node:14.17.5-alpine AS BUILD_IMAGE | ||
|
||
ARG TARGETPLATFORM | ||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} | ||
|
||
# Install additional tools needed on arm64 and armv7 | ||
RUN \ | ||
case "${TARGETPLATFORM}" in \ | ||
'linux/arm64') apk add --no-cache python make g++ ;; \ | ||
'linux/arm/v7') apk add --no-cache python make g++ ;; \ | ||
esac | ||
|
||
# Create and set the working directory | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile --network-timeout 1000000 | ||
|
||
# Copy over all project files and folders to the working directory | ||
COPY . ./ | ||
|
||
# Build initial app for production | ||
RUN yarn build | ||
|
||
# # remove development dependencies | ||
# RUN yarn install --production --ignore-scripts --prefer-offline | ||
|
||
# Build the final image | ||
FROM node:14.17.5-alpine | ||
FROM node:lts-alpine3.14 | ||
|
||
# Define some ENV Vars | ||
ENV PORT=80 \ | ||
DIRECTORY=/app \ | ||
IS_DOCKER=true | ||
DIRECTORY=/app \ | ||
IS_DOCKER=true | ||
|
||
# Create and set the working directory | ||
WORKDIR ${DIRECTORY} | ||
|
||
# Install tini and tzdata | ||
RUN apk add --no-cache tzdata tini | ||
# Copy over both 'package.json' and 'package-lock.json' (if available) | ||
COPY package*.json ./ | ||
COPY yarn.lock ./ | ||
|
||
# copy from build image | ||
COPY --from=BUILD_IMAGE /app ./ | ||
# Install project dependencies | ||
RUN yarn | ||
|
||
# Finally, run start command to serve up the built application | ||
ENTRYPOINT [ "/sbin/tini", "--" ] | ||
CMD [ "yarn", "build-and-start" ] | ||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
FROM node:14.17.5-alpine AS BUILD_IMAGE | ||
|
||
ARG TARGETPLATFORM | ||
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} | ||
|
||
# Install additional tools needed on arm64 and armv7 | ||
RUN \ | ||
case "${TARGETPLATFORM}" in \ | ||
'linux/arm64') apk add --no-cache python make g++ ;; \ | ||
'linux/arm/v7') apk add --no-cache python make g++ ;; \ | ||
esac | ||
|
||
# Create and set the working directory | ||
WORKDIR /app | ||
|
||
COPY package.json yarn.lock ./ | ||
RUN yarn install --frozen-lockfile --network-timeout 1000000 | ||
|
||
# Copy over all project files and folders to the working directory | ||
COPY . ./ | ||
|
||
# Build initial app for production | ||
RUN yarn build | ||
|
||
# Build the final image | ||
FROM node:14.17.5-alpine | ||
|
||
# Define some ENV Vars | ||
ENV PORT=80 \ | ||
DIRECTORY=/app \ | ||
IS_DOCKER=true | ||
|
||
# Create and set the working directory | ||
WORKDIR ${DIRECTORY} | ||
|
||
# Install tini and tzdata | ||
RUN apk add --no-cache tzdata tini | ||
|
||
# copy from build image | ||
COPY --from=BUILD_IMAGE /app ./ | ||
|
||
# Finally, run start command to serve up the built application | ||
ENTRYPOINT [ "/sbin/tini", "--" ] | ||
CMD [ "yarn", "build-and-start" ] | ||
|
||
# Expose given port | ||
EXPOSE ${PORT} | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters