-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (26 loc) · 1018 Bytes
/
Dockerfile
File metadata and controls
37 lines (26 loc) · 1018 Bytes
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
FROM node:17-alpine as builder
# make the 'app' folder the current working directory
WORKDIR /app
# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
# install project dependencies
RUN npm ci --legacy-peer-deps
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
ARG VUE_APP_VERSION_ID=production
ARG VUE_APP_BUILD_ID=local
# build app for production with minification
RUN npm run build --legacy-peer-deps
FROM caddy:2.6.4-alpine
# copy build artifacts to webserver root
RUN rm -rf /usr/share/caddy
COPY --from=builder /app/dist /usr/share/caddy
# copy webserver configuration
COPY ./Caddyfile /etc/caddy/Caddyfile
# Create a group and user
RUN addgroup --gid 9999 iris && adduser --disabled-password --gecos '' --uid 9999 -G iris -s /bin/ash iris
COPY --chown=iris:iris ./autosave.json /config/caddy/autosave.json
# Change to non-root privilege
USER iris:iris
# note: exposed port needs to match port in Caddyfile
EXPOSE 28080