-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
57 lines (42 loc) · 1.38 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
ARG registry=942286566325.dkr.ecr.eu-west-1.amazonaws.com
FROM ${registry}/figshare/debian:11 AS development
LABEL org.opencontainers.image.source https://github.com/figshare/fcl
ENV ENV=production
ENV TERM=xterm
ENV ELASTIC_APM_LOG_LEVEL=fatal
ARG projdir=/app
ARG CI=true
# Base
RUN apt-get update
RUN apt-get install --no-install-recommends -y \
curl git make openssh-client
RUN mkdir -p -m 0600 /root/.ssh
RUN ssh-keyscan github.com >> /root/.ssh/known_hosts
RUN apt-get install --no-install-recommends -y \
gnupg ca-certificates \
libmariadb-dev libmariadb-dev-compat \
libssl-dev build-essential libmagic1
RUN apt-get update && apt-get install --no-install-recommends -y nodejs npm
RUN set -ex && node -v && npm -v
COPY . $projdir
WORKDIR $projdir
RUN --mount=type=ssh --mount=type=secret,id=npmrc,dst=/root/.npmrc \
make install
RUN --mount=type=ssh --mount=type=secret,id=npmrc,dst=/root/.npmrc \
make build
FROM ${registry}/figshare/nginx:1.18 AS deployment
COPY --from=development /app/build /app
RUN rm -f /etc/nginx/sites-available/default /etc/nginx/sites-enabled/default
RUN echo "" > /etc/nginx/modules-enabled/modules.conf
RUN cat <<EOF > /etc/nginx/sites-enabled/default.conf
server {
listen 80 default_server;
server_name _;
error_log /dev/stdout info;
location / {
root /app;
index index.html;
}
}
EOF
RUN nginx -t