-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
42 lines (42 loc) · 876 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
42
FROM alpine:latest
LABEL maintainer [email protected]
COPY / /tmp/jugendwerkstatt.client
ARG REACT_APP_HOST
ENV REACT_APP_HOST $REACT_APP_HOST
RUN \
#
# packages
apk --no-cache add \
nginx && \
apk --no-cache --virtual build add \
g++ \
make \
npm \
python3 && \
#
# jugendwerkstatt.client
cd /tmp/jugendwerkstatt.client && \
npm install && \
npm run -- build && \
mkdir -p /usr/share/webapps && \
mv build /usr/share/webapps/jugendwerkstatt.client && \
#
# deploy
echo \
'server {' \
'listen 80;' \
'listen [::]:80;' \
'root /usr/share/webapps/jugendwerkstatt.client;' \
'location / {' \
'try_files $uri /index.html;' \
'}' \
'}' \
> /etc/nginx/http.d/default.conf && \
#
# cleanup
apk del --purge build && \
find /root /tmp -mindepth 1 -delete
#
# runtime
CMD nginx -g 'daemon off;'
EXPOSE 80