Files
discordeno/docker-apps/rest-passthrough/Dockerfile
Matthew Hatcher fa5cbd8ac9 feat!: rewrite proxy app with fastify (#3269)
* feat: initial fastify source

* chore: remove extra stuff from git ignore

* feat: rename to rest passthrough

* feat: add swcrc file

* feat: add Dockerfile

* feat: more rest passthrough stuff

* fix: add node_modules to Dockerfile

* feat: misc passthrough changes

* feat: add host to dockerfile

* feat: add version tags and update names

* feat: remove the old proxy application

* feat: update registry package name

* feat: re-add schedule

* feat: cliff jumper initi

* feat: update changelog

* style: git cliff formatting

* feat: update cliffjumper rc

* feat: updating version for future cliff-jump run

* revert: package name back

* feat: add release script

* feat: update dependabot configuration to manage rest passthrough app

* chore: update actions/download-artifact version

* feat: adding removal of the version in URL.

* feat: making readme better
2023-12-20 23:05:43 +00:00

46 lines
1.4 KiB
Docker

# we node 18 alpine 3.19 as base image
# we use multi stage build in this file
# deps
# contain all dependencies including dev dependencies
# builder
# contains all compiled files
# runner
# the final image, with only the dependencies and compiled files
# build only with the platform of the host machine, since it only uses for dev purposes
FROM --platform=$BUILDPLATFORM node:18.19.0-alpine3.19 AS deps
WORKDIR /app
# copy necessary for install dependencies
COPY package.json yarn.lock .yarnrc.yml ./
COPY ./.yarn/releases ./.yarn/releases
# install dependencies
RUN yarn install --immutable
# build only with the platform of the host machine, since we just need its files
FROM --platform=$BUILDPLATFORM node:18.19.0-alpine3.19 AS builder
# copy the dependencies (node_modules) from the deps image
COPY --from=deps /app /app
WORKDIR /app
# copy the source files
COPY src/ src/
# copy the compiler config
COPY .swcrc ./
# compile the files
RUN yarn build
FROM node:18.19.0-alpine3.19 AS runner
# copy the compiled files from the builder image
COPY --from=builder /app/dist /app/dist
# copy the dependencies from the deps image
COPY --from=deps /app/node_modules /app/node_modules
COPY --from=deps /app/.yarn /app/.yarn
WORKDIR /app
# copy necessary files
COPY package.json yarn.lock .yarnrc.yml ./
ENV HOST=0.0.0.0
# open port 8000
EXPOSE 8000
# set default command
CMD ["yarn" ,"start:prod"]