File size: 1,628 Bytes
91aa31c
 
bfc8654
 
 
07fb169
 
 
bfc8654
91aa31c
193399b
419551d
91aa31c
09fa5ac
 
 
f513d70
b660b4c
91aa31c
815e793
 
91aa31c
40a4c21
91aa31c
404c8c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91aa31c
404c8c2
 
7b0ed6c
404c8c2
7b0ed6c
b660b4c
404c8c2
 
 
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Muitistage Dockerfile to first build the static site, then using nginx serve the static site
FROM ruby:3.4.3 as builder

# GBIF dockerfile
RUN gem sources --add https://repository.gbif.org/repository/rubygems.org/ && \
    gem sources --remove https://rubygems.org/
    
RUN bundle config set mirror.https://rubygems.org https://repository.gbif.org/repository/rubygems.org

WORKDIR /usr/src/app
COPY Gemfile ./
# RUN bundle config set frozen true
RUN bundle install

RUN echo here

COPY . .
RUN bundle exec jekyll build --baseurl ""

RUN find /usr/src/app/_site -type f -ls

#Copy _sites from build to Nginx Container to serve site
USER root
FROM nginx:latest

RUN mkdir -p /var/cache/nginx \
             /var/log/nginx \
             /var/lib/nginx \
             /usr/share/nginx/html

RUN touch /var/run/nginx.pid

RUN groupadd user
RUN useradd -d /home/user -ms /bin/bash -g user -G user -p user user
RUN chown -R user:user /var/cache/nginx \
                       /var/log/nginx \
                       /var/lib/nginx \
                       /var/run/nginx.pid \
                       /usr/share/nginx/html

#--- update nginx config;  establish routes/proxy pass;  remove user directive
COPY ./nginx/etc.nginx.confd_default.conf /etc/nginx/conf.d/default.conf
COPY ./nginx/etc.nginx_nginx.conf /etc/nginx/nginx.conf


COPY --from=builder /usr/src/app/_site /usr/share/nginx/html

COPY --chown=user ./_env_config/stg_dev/utl_dkr_preRun.sh ./scripts/docker/
RUN chmod +x ./scripts/docker/utl_dkr_preRun.sh

USER user
EXPOSE 7860
ENTRYPOINT [ "./scripts/docker/utl_dkr_preRun.sh" ]

# CMD ["nginx", "-g", "daemon off;"]