forked from CronCats/croncat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
44 lines (30 loc) · 1011 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
# = = = = = = = = = = = = = = = = = = = = = =
# Build Stage - This stage will intall node modules and build for prod
# = = = = = = = = = = = = = = = = = = = = = =
FROM mhart/alpine-node:latest as builder
WORKDIR /app
RUN apk add --no-cache python3 make g++
COPY package.json .
COPY yarn.lock .
RUN yarn
COPY . .
# Build and package the agent into a binary named 'croncat-agent'
RUN yarn package
# Build and package the cli into a binary named 'croncat-cli'
RUN yarn package:cli
# Copy the default .env values over
RUN mv .env.example .env
# = = = = = = = = = = = = = = = = = = = = = =
# Run stage
# This stage will run our app
# = = = = = = = = = = = = = = = = = = = = = =
FROM node:alpine
WORKDIR /app
# install required libs
RUN apk update && apk add --no-cache libstdc++ libgcc
# copy prebuilt binary from previous step
COPY --from=builder /app/croncat-cli croncat-cli
COPY --from=builder /app/croncat-agent croncat-agent
COPY --from=builder /app/.env .env
EXPOSE 2000
CMD [ "./croncat-agent" ]