23brewert
Explore posts from serversIssues running nuxt 3 with docker
here is my docker ignore file:
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
# Include any files or directories that you don't want to be copied to your
# container here (e.g., local build artifacts, temporary files, etc.).
#
# For more help, visit the .dockerignore file reference guide at
# https://docs.docker.com/go/build-context-dockerignore/
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/.next
**/.cache
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/charts
**/docker-compose*
**/compose.y*ml
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
**/build
**/dist
LICENSE
README.md
3 replies
Issues running nuxt 3 with docker
Here is my dockerfile [I got it from an article]
# use node 20 alpine image
FROM node:20-alpine
# create work directory in app folder
WORKDIR /app
# install required packages for node image
RUN apk --no-cache add openssh g++ make python3 git
# copy over package.json files
COPY package.json /app/
COPY package-lock.json /app/
# install all depencies
RUN npm ci && npm cache clean --force
# copy over all files to the work directory
ADD . /app
# build the project
RUN npm run build
# expose the host and port 3000 to the server
ENV HOST 0.0.0.0
EXPOSE 4000
# run the build project with node
ENTRYPOINT ["node", ".output/server/index.mjs"]
# use node 20 alpine image
FROM node:20-alpine
# create work directory in app folder
WORKDIR /app
# install required packages for node image
RUN apk --no-cache add openssh g++ make python3 git
# copy over package.json files
COPY package.json /app/
COPY package-lock.json /app/
# install all depencies
RUN npm ci && npm cache clean --force
# copy over all files to the work directory
ADD . /app
# build the project
RUN npm run build
# expose the host and port 3000 to the server
ENV HOST 0.0.0.0
EXPOSE 4000
# run the build project with node
ENTRYPOINT ["node", ".output/server/index.mjs"]
3 replies