Skip to content

Commit

Permalink
fix: new docker image with cached steps #150
Browse files Browse the repository at this point in the history
  • Loading branch information
wazolab committed Feb 1, 2024
1 parent af0a95e commit af4a83e
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions Dockerfile
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" ]

0 comments on commit af4a83e

Please sign in to comment.