-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (48 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
57 lines (48 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# build step
FROM node:lts-alpine as build-stage
# Create app directory
WORKDIR /app
# Chromium for Puppeteer pre-rendering at build time
RUN apk add --no-cache chromium
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
ENV PUPPETEER_SKIP_DOWNLOAD=true
# args
ARG NODE_ENV='development'
ARG DEVKIT_VUE_app_title='Devkit-Docker'
ARG DEVKIT_VUE_api_protocol='http'
ARG DEVKIT_VUE_api_host='localhost'
ARG DEVKIT_VUE_api_port='3000'
ARG DEVKIT_VUE_api_base='api'
ARG DEVKIT_VUE_cookie_prefix='waos'
# Analytics ARGs: declared without defaults so BuildKit does NOT leak empty
# strings into process.env at build time. With defaults, BuildKit exposes
# the ARG as an env var to RUN steps, and generateConfig.js Layer 5
# (DEVKIT_VUE_* env-var override) silently overrides downstream
# config-file values with the empty/false defaults. Issue: pierreb-devkit/Vue#4110
ARG DEVKIT_VUE_analytics_sentry_dsn
ARG DEVKIT_VUE_analytics_sentry_environment
ARG DEVKIT_VUE_analytics_posthog_key
ARG DEVKIT_VUE_analytics_posthog_host
ARG DEVKIT_VUE_analytics_posthog_errorTracking
ARG DEVKIT_VUE_analytics_posthog_autoCapture
ARG DEVKIT_VUE_analytics_posthog_sessionReplay
ARG DEVKIT_VUE_analytics_posthog_featureFlags
ARG DEVKIT_VUE_analytics_posthog_surveys
ARG DEVKIT_VUE_analytics_posthog_webVitals
ARG DEVKIT_VUE_analytics_posthog_capturePageleave
# Install app dependencies & build
COPY package*.json ./
RUN npm install
COPY . .
RUN NODE_ENV=$NODE_ENV npm run build
# prod step
FROM nginx:stable-alpine as production-stage
# Copy all build
COPY --from=build-stage /app/dist /usr/share/nginx/html
# Add nginx config
COPY nginx.example.conf /temp/prod.conf
RUN envsubst /app < /temp/prod.conf > /etc/nginx/conf.d/default.conf
# Expose
EXPOSE 80
# Command to run
CMD ["nginx", "-g", "daemon off;"]