-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from qdm12/dockerfile-improvements
Dockerfile improvements
- Loading branch information
Showing
5 changed files
with
57 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.git | ||
.dockerignore | ||
.gitignore | ||
Dockerfile | ||
README.md | ||
LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
# multistage - builder image | ||
FROM node:alpine AS builder | ||
ARG ALPINE_VERSION=3.12 | ||
ARG NODE_VERSION=15 | ||
ARG NGINX_VERSION=1.19.6 | ||
|
||
FROM node:${NODE_VERSION}-alpine${ALPINE_VERSION} AS builder | ||
WORKDIR /app/Lightspeed-react | ||
COPY . . | ||
COPY package.json package-lock.json ./ | ||
RUN npm install | ||
|
||
# configure ip, hardcoded to webrtc container address (8080) for now | ||
RUN sed -i "s|stream.gud.software|localhost|g" public/config.json | ||
|
||
# build it | ||
COPY . . | ||
RUN npm run build | ||
|
||
# runtime image | ||
FROM nginx:stable | ||
COPY --from=builder /app/Lightspeed-react/build /usr/share/nginx/html | ||
|
||
FROM nginx:${NGINX_VERSION}-alpine | ||
ENV WEBSOCKET_HOST=localhost | ||
ENV WEBSOCKET_PORT=8080 | ||
EXPOSE 80/tcp | ||
COPY --chown=1000 docker/entrypoint.sh /docker-entrypoint.d/entrypoint.sh | ||
COPY --chown=1000 docker/config.json.template /config.json.template | ||
COPY --from=builder --chown=1000 /app/Lightspeed-react/build /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"wsUrl": "ws://${WEBSOCKET_HOST}:${WEBSOCKET_PORT}/websocket" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
envsubst < /config.json.template > "/usr/share/nginx/html/config.json" |