forked from foyzulkarim/mern-video-streaming
-
Notifications
You must be signed in to change notification settings - Fork 0
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 foyzulkarim#73 from foyzulkarim/feature/dockerize-app
Dockerize the project and run everything inside of docker
- Loading branch information
Showing
16 changed files
with
230 additions
and
4,189 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
build |
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,2 @@ | ||
REACT_APP_API_SERVER='https://www.google.com' | ||
REACT_APP_VIDEO_SERVER='https://www.amazon.com' |
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,14 @@ | ||
# Stage 1 | ||
FROM node:18-alpine as builder | ||
ARG REACT_APP_API_SERVER | ||
ARG REACT_APP_VIDEO_SERVER | ||
RUN echo "REACT_APP_VIDEO_SERVER is set to $REACT_APP_VIDEO_SERVER" | ||
|
||
WORKDIR /app | ||
COPY . . | ||
RUN yarn | ||
ENV REACT_APP_API_SERVER=$REACT_APP_API_SERVER | ||
ENV REACT_APP_VIDEO_SERVER=$REACT_APP_VIDEO_SERVER | ||
RUN yarn build | ||
EXPOSE 3000 | ||
CMD [ "npx", "serve", "build" ] |
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,14 @@ | ||
version: "3" | ||
|
||
services: | ||
client: | ||
container_name: client-app | ||
image: docker-mern-video-streaming-client | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
- REACT_APP_API_SERVER=${REACT_APP_API_SERVER} | ||
- REACT_APP_VIDEO_SERVER=${REACT_APP_VIDEO_SERVER} | ||
ports: | ||
- 3000:3000 |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export const API_SERVER = "http://localhost:4000"; | ||
export const VIDEO_SERVER = "http://localhost:4001"; | ||
export const API_SERVER = process.env.REACT_APP_API_SERVER || "http://localhost:4000"; | ||
export const VIDEO_SERVER = process.env.REACT_APP_VIDEO_SERVER || "http://localhost:4001"; |
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 @@ | ||
node_modules |
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,8 @@ | ||
FROM node:18-alpine | ||
WORKDIR /app | ||
ADD package*.json ./ | ||
RUN npm install | ||
COPY . . | ||
EXPOSE 4000 | ||
EXPOSE 4001 | ||
CMD [ "npm", "start"] |
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
Oops, something went wrong.