-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: new docker image with cached steps #150
- Loading branch information
Showing
1 changed file
with
24 additions
and
18 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,26 +1,32 @@ | ||
ARG NODE_VERSION | ||
FROM node:${NODE_VERSION} | ||
# syntax = docker/dockerfile:1 | ||
|
||
RUN apk --no-cache add git | ||
# Base | ||
ARG NODE_VERSION=18.19.0 | ||
|
||
# Create app directory | ||
RUN mkdir -p /usr/src/app/.nuxt | ||
WORKDIR /usr/src/app | ||
FROM node:${NODE_VERSION}-slim as base | ||
|
||
# Install app dependencies | ||
COPY package.json yarn.lock /usr/src/app/ | ||
RUN yarn install | ||
COPY . /usr/src/app | ||
ARG PORT=3000 | ||
|
||
ENV NODE_ENV=production | ||
|
||
WORKDIR /src | ||
|
||
# Build | ||
FROM base as build | ||
|
||
COPY --link .yarn ./.yarn | ||
COPY --link package.json yarn.lock .yarnrc.yml ./ | ||
RUN yarn install | ||
|
||
ENV NODE_OPTIONS --openssl-legacy-provider | ||
COPY vidos-config-empty.json vidos-config.json | ||
COPY --link . . | ||
|
||
RUN yarn build | ||
|
||
# Set environment variables | ||
ENV NODE_ENV production | ||
ENV NUXT_HOST 0.0.0.0 | ||
ENV NUXT_PORT 3000 | ||
# Run | ||
FROM base | ||
|
||
ENV PORT=$PORT | ||
|
||
COPY --from=build /src/.output /src/.output | ||
|
||
EXPOSE 3000 | ||
CMD [ "yarn", "start" ] | ||
CMD [ "node", ".output/server/index.mjs" ] |