-
-
Save konung/9022fb484e7e924070b49eecf3c82fd2 to your computer and use it in GitHub Desktop.
Dockerfile for http://luckyframework.org deployment
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
FROM crystallang/crystal:0.27.2 as builder | |
RUN apt-get update \ | |
&& apt-get install -y --no-install-recommends build-essential \ | |
apt-transport-https curl ca-certificates gnupg2 apt-utils | |
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \ | |
&& apt-get install -y nodejs | |
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | |
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | |
&& apt-get update \ | |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y yarn | |
ENV LUCKY_ENV production | |
WORKDIR /src | |
COPY shard.* ./ | |
RUN shards install | |
COPY yarn.lock package.json ./ | |
RUN yarn install --production | |
COPY . . | |
RUN crystal build --release --static src/server.cr -o ./server | |
RUN yarn prod | |
FROM ubuntu:latest | |
WORKDIR /app | |
COPY --from=builder /src/server /app/ | |
COPY --from=builder /src/public /app/public | |
ENV LUCKY_ENV=production | |
ENTRYPOINT ["./server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment