forked from rinkp/custommailcow-ldap
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
49 lines (33 loc) · 1022 Bytes
/
Dockerfile
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
# We build our container using node:16-alpine
FROM node:20-alpine AS builder
ENV NODE_ENV=development
# Change dir to install dir.
WORKDIR /usr/src/custommailcow-ldap
# Copy over the package and package-lock
COPY package*.json .
# Install dependencies
RUN npm ci
# Copy over the tsconfig
COPY tsconfig.json .
# Copy over the source files
COPY src /usr/src/custommailcow-ldap/src
# Transpile the typescript files
RUN npx tsc
# Create production container.
FROM node:20-alpine AS prod
# Set correct dir.
WORKDIR /app
# Copy over the package and package-lock
COPY package*.json .
# Install production dependencies
RUN npm install --only=production
# Copy over the template data
COPY templates /app/templates
# Copy over the source files from the builder
COPY --from=builder /usr/src/custommailcow-ldap/dist /app/src
# Set correct priv.
USER root
VOLUME [ "/app/db" ]
VOLUME [ "/app/conf/dovecot" ]
VOLUME [ "/app/conf/sogo" ]
CMD ["node", "/app/src/index.js"]