mirror of
https://github.com/owntracks/frontend.git
synced 2026-08-25 20:47:16 +00:00
Update Dockerfile for v2
This commit is contained in:
+21
-8
@@ -1,11 +1,24 @@
|
||||
FROM nginx:alpine
|
||||
EXPOSE 80
|
||||
FROM node:10 as build
|
||||
LABEL version="2.0.0-alpha"
|
||||
LABEL description="OwnTracks UI"
|
||||
LABEL maintainer="Linus Groh <mail@linusgroh.de>"
|
||||
WORKDIR /usr/src/app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
COPY . ./
|
||||
RUN yarn build
|
||||
|
||||
FROM nginx:1.17-alpine
|
||||
ENV LISTEN_PORT=80 \
|
||||
SERVER_HOST=otrecorder \
|
||||
SERVER_PORT=80
|
||||
|
||||
COPY nginx.tmpl /etc/nginx/nginx.tmpl
|
||||
COPY index.html /usr/share/nginx/html
|
||||
COPY static/ /usr/share/nginx/html/static/
|
||||
|
||||
CMD /bin/sh -c "envsubst '\${SERVER_HOST} \${SERVER_PORT} \${LISTEN_PORT}' < /etc/nginx/nginx.tmpl > /etc/nginx/nginx.conf && nginx -g 'daemon off;' || ( env; cat /etc/nginx/nginx.conf )"
|
||||
COPY ./docker/nginx.tmpl /etc/nginx/nginx.tmpl
|
||||
COPY --from=build /usr/src/app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
CMD /bin/sh -c " \
|
||||
envsubst '\${SERVER_HOST} \${SERVER_PORT} \${LISTEN_PORT}' \
|
||||
< /etc/nginx/nginx.tmpl \
|
||||
> /etc/nginx/nginx.conf \
|
||||
&& nginx -g 'daemon off;' \
|
||||
|| ( env; cat /etc/nginx/nginx.conf ) \
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user