Simplified dockerfile

This commit is contained in:
Dominic Grimm 2022-01-10 17:53:38 +01:00
parent 60a714fa82
commit 92ee590d94

View file

@ -9,8 +9,7 @@ WORKDIR /app
COPY --from=micrate-deps /app/shard.yml /app/shard.lock ./
COPY --from=micrate-deps /app/lib lib/
COPY ./micrate/src ./src
COPY ./scripts ./scripts
RUN . ./scripts/build.sh ${BUILD_ENV}
RUN shards build --production --static --release --no-debug --verbose -s -p -t
FROM crystallang/crystal:latest-alpine as deps
WORKDIR /app
@ -24,9 +23,11 @@ WORKDIR /app
COPY --from=deps /app/shard.yml /app/shard.lock ./
COPY --from=deps /app/lib ./lib
COPY ./src ./src
COPY ./scripts ./scripts
RUN . ./scripts/build.sh ${BUILD_ENV}
RUN if [ "${BUILD_ENV}" = "development" ]; then \
shards build --static --verbose -s -p -t; \
else \
shards build --static --release --no-debug --verbose -s -p -t; \
fi
FROM scratch as runner
WORKDIR /
COPY --from=micrate-builder /app/bin/micrate ./bin/micrate