-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (29 loc) · 953 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
FROM ruby:3.2.3 AS jekyll
RUN apt-get install -y libffi-dev
WORKDIR /root
COPY blog/Gemfile blog/Gemfile.lock ./
RUN bundle install --deployment
COPY blog /root
RUN mkdir /app && \
bundle exec jekyll build --config _config.yml --destination /app
FROM crystallang/crystal:1.9-alpine AS crystal
COPY dicer /app
WORKDIR /app
RUN shards install
RUN mkdir -p bin
RUN crystal build --static --release -o bin/dicer ./server.cr
FROM alpine:latest
RUN apk add --no-cache --update nginx gettext && \
ln -sf /dev/stdout /var/log/nginx/access.log && \
ln -sf /dev/stderr /var/log/nginx/error.log
RUN mkdir /app && \
mkdir /etc/nginx/locations && \
mkdir /etc/nginx/servers
COPY nginx/nginx.conf /etc/nginx/nginx.conf
COPY nginx/servers /etc/nginx/servers/
COPY nginx/locations /etc/nginx/locations/
COPY bin/entrypoint /
COPY --from=crystal /app/bin/dicer /dicer
COPY --from=jekyll /app /app
ENV PORT 8080
ENTRYPOINT ["/entrypoint"]