-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
52 lines (38 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
52 lines (38 loc) · 1.22 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
FROM node:12.16.1-buster-slim AS builder
RUN mkdir -p /build
WORKDIR /build
RUN apt-get update &&\
apt-get install -y git --no-install-recommends &&\
rm -rf /var/lib/apt/lists/*
COPY . /build
RUN yarn && yarn build
FROM node:12.16.1-buster-slim
LABEL com.purrplingcat.name="PurrplingBot"
LABEL com.purrplingcat.version="2.0.0"
LABEL com.purrplingcat.vendor="PurrplingCat"
LABEL com.purrplingcat.email="dev@purrplingcat.com"
LABEL com.purrplingcat.github="https://github.com/PurrplingCat/PurrplingBot"
ENV DEBUG=0
ENV APP_DIR="/opt/PurrplingBot"
ENV APP_CONFIG_DIR="/data/config"
ENV PATH=$APP_DIR/bin:$PATH
# Install binary dependencies
RUN apt-get update &&\
apt-get install -y git --no-install-recommends &&\
rm -rf /var/lib/apt/lists/*
# Create app place
RUN mkdir -p $APP_DIR
WORKDIR $APP_DIR
# Copy bundle, install main&plugin deps
COPY --from=builder /build/package.json .
COPY --from=builder /build/.yarnrc .
COPY --from=builder /build/yarn.lock .
COPY --from=builder /build/dist/ dist/
COPY --from=builder /build/bin/ bin/
COPY --from=builder /build/data/ data/
RUN yarn --production
# Redirect configs to /data/config
RUN ln -s $APP_CONFIG_DIR config
VOLUME /data/config
# Start PurrplingBot
CMD ["yarn", "start"]