This repository has been archived by the owner on Apr 4, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (46 loc) · 1.5 KB
/
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
FROM node:12-buster as builder
LABEL maintainer="Abel Luck <[email protected]>"
ARG SIGARILLO_DIR=/opt/sigarillo
RUN mkdir -p ${SIGARILLO_DIR}/
COPY package.json yarn.lock ${SIGARILLO_DIR}/
RUN chown -R node:node ${SIGARILLO_DIR}/
USER node
WORKDIR ${SIGARILLO_DIR}
RUN yarn --production
FROM node:12-buster
LABEL maintainer="Abel Luck <[email protected]>"
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
ARG VERSION
LABEL org.label-schema.schema-version="1.0"
LABEL org.label-schema.name="abeluck/sigarillo"
LABEL org.label-schema.description="Write Signal bots with https"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.vcs-url=$VCS_URL
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.version=$VERSION
ARG SIGARILLO_DIR=/opt/sigarillo
ENV SIGARILLO_DIR ${SIGARILLO_DIR}
ENV SIGARILLO_READY_FILE ${SIGARILLO_DIR}/sigarillo.ready
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
apt-get install -y --no-install-recommends \
dumb-init postgresql-client
RUN mkdir -p ${SIGARILLO_DIR}
RUN chown -R node:node ${SIGARILLO_DIR}/
RUN mkdir -p /var/lib/sigarillo
RUN chown -R node:node /var/lib/sigarillo
COPY docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
USER node
WORKDIR ${SIGARILLO_DIR}
COPY --from=builder ${SIGARILLO_DIR}/node_modules ./node_modules
EXPOSE 3000
ENV PORT 3000
ENV SECRETS changeme
ENV NODE_ENV production
ENV DATA_PATH /var/lib/sigarillo
ENV DB_CLIENT pg
COPY src ./src
COPY package.json ./
ENTRYPOINT ["/docker-entrypoint.sh"]