Skip to content

Commit

Permalink
Switch to node 20 in docker (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo authored Apr 22, 2024
1 parent 34b4ecb commit 0e5e49b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.12.2
23 changes: 7 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
ARG NODE_VERSION
FROM node:${NODE_VERSION}

RUN apk --no-cache add git
WORKDIR /app
RUN corepack enable

# Create app directory
RUN mkdir -p /usr/src/app/.nuxt
WORKDIR /usr/src/app

# Install app dependencies
COPY package.json yarn.lock /usr/src/app/
RUN yarn install
RUN yarn add -D serve
COPY . /usr/src/app
COPY package.json yarn.lock /app/
RUN yarn install
RUN yarn generate

# Set environment variables
ENV NODE_ENV production
ENV NUXT_HOST 0.0.0.0
ENV NUXT_PORT 3000
COPY . .
RUN yarn install
RUN yarn build

EXPOSE 3000
CMD [ "yarn", "start" ]
CMD [ "node", ".output/server/index.mjs" ]
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ services:
build:
context: .
args:
NODE_VERSION: 16-alpine3.16
NODE_VERSION: 20.12.2-alpine3.19
environment:
- API=${API}
ports:
- '3000:3000'
- 3000:3000

0 comments on commit 0e5e49b

Please sign in to comment.