-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1.0.3: [feature] Creates Dockerfile for croncat agent
- Loading branch information
1 parent
d4bf676
commit 1adb8d8
Showing
4 changed files
with
690 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,5 @@ | |
node_modules | ||
|
||
dist | ||
.cache | ||
.cache | ||
.dockerignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# = = = = = = = = = = = = = = = = = = = = = = | ||
# 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 ap into a binary named 'croncat-agent' | ||
RUN yarn package | ||
|
||
# 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-agent croncat-agent | ||
COPY --from=builder /app/.env .env | ||
|
||
EXPOSE 2000 | ||
|
||
CMD [ "./croncat-agent" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.