-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (28 loc) · 834 Bytes
/
Dockerfile
File metadata and controls
35 lines (28 loc) · 834 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
# Stage 1 - the build process
FROM node:lts-alpine AS build-deps
LABEL maintainer="gregoire@joncour.dev"
WORKDIR /usr/src/app
RUN apk add --no-cache git
ARG TWITCH_CLIENTID
ARG COUNTER_URL
ARG COUNTER_ID
ARG COUNTER_UTCOFFSET
ARG TOUAPI
ENV TWITCH_CLIENTID=${TWITCH_CLIENTID}
ENV COUNTER_URL=${COUNTER_URL}
ENV COUNTER_ID=${COUNTER_ID}
ENV COUNTER_UTCOFFSET=${COUNTER_UTCOFFSET}
ENV TOUAPI=${TOUAPI}
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build-prod
# Stage 2 - the production environment with Caddy
FROM caddy:alpine
LABEL maintainer="gregoire@joncour.dev"
# Copy built files to Caddy's web root
COPY --from=build-deps /usr/src/app/dist /usr/share/caddy
# Provide a basic Caddyfile
COPY Caddyfile /etc/caddy/Caddyfile
EXPOSE 80
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile", "--adapter", "caddyfile"]