-
-
Notifications
You must be signed in to change notification settings - Fork 136
/
Dockerfile
30 lines (21 loc) · 734 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
# We are using crystal as image we are building the binary on
FROM crystallang/crystal:1.9.1-alpine AS build
# Create a build directory and set it as default
RUN mkdir -p /opt/mint
WORKDIR /opt/mint
# Copy source
COPY . .
# Install dependencies (shards)
RUN shards install
# Build binary
RUN shards build --static --no-debug --release
# This will be the actual base image
FROM alpine
# Install imagemagick (to generate favicons) and git (to install dependencies)
RUN apk add --update --no-cache imagemagick bash pngcrush optipng git less openssh
# Copy the binary
COPY --from=build /opt/mint/bin/mint /bin/mint
# Set the binary as entrypoint
ENTRYPOINT [ "/bin/mint" ]
# Set the default command as the server
CMD [ "start" ]