pickstack

Vue + Docker

Multi-stage Dockerfile: nginx for static sites, a Node server for apps that need one. This page shows exactly what pickstack adds to a Vue project for Docker: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework vue --modules docker --yes
Customize in the configurator

New files

.dockerignore
node_modules
dist
build
.output
.nuxt
.next
.svelte-kit
.astro
.angular
.git
.env
.env.*
!.env.example
*.log
Dockerfile
.dockerignore
Dockerfile
# syntax=docker/dockerfile:1

FROM node:24-alpine AS build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY . .
RUN npm run build

FROM nginx:1.29-alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
nginx.conf
server {
  listen 80;
  server_name _;
  root /usr/share/nginx/html;
  index index.html;

  # Hashed file names change with every build, so they can be cached for good.
  location /assets/ {
    expires 1y;
    add_header Cache-Control "public, immutable";
  }

  location / {
    try_files $uri $uri/ /index.html;
  }
}

Project files

Related templates