-
-
Notifications
You must be signed in to change notification settings - Fork 385
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add dockerfile and docker-compose
- Loading branch information
Showing
5 changed files
with
94 additions
and
0 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,19 @@ | ||
.git | ||
.gitignore | ||
.github | ||
.vscode | ||
.editorconfig | ||
.dockerignore | ||
.angular | ||
.electron | ||
.husky | ||
Dockerfile | ||
README.md | ||
dist | ||
e2e | ||
node_modules | ||
screenshots | ||
test-results | ||
coverage | ||
build | ||
release |
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,31 @@ | ||
# Stage 1 - build environment | ||
FROM node:16-alpine AS build | ||
|
||
RUN apk add --no-cache python3 make g++ | ||
|
||
# Create app directory | ||
WORKDIR /usr/src/app | ||
|
||
# Swtich to node user | ||
#RUN chown node:node ./ | ||
#USER node | ||
|
||
COPY package*.json ./ | ||
|
||
# Install app dependencies | ||
RUN npm ci && npm cache clean --force | ||
|
||
# Copy all required files | ||
COPY . . | ||
|
||
# Build the application | ||
RUN npm run build:web | ||
|
||
# Stage 2 - the production environment | ||
FROM nginx:stable-alpine | ||
|
||
# Copy artifacts and nignx.conf | ||
COPY --from=build /usr/src/app/dist/ /usr/share/nginx/html | ||
COPY --from=build /usr/src/app/docker/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
CMD sed -i "s/localhost:3333/localhost:$BACKEND_PORT/g" /usr/share/nginx/html/main.*.js && nginx -g 'daemon off;' |
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,16 @@ | ||
# Self-hosted version of IPTVnator | ||
|
||
You can deploy and run the PWA version of IPTVnator on your own machine with `docker-compose` using the following command: | ||
|
||
$ cd docker | ||
$ docker-compose run -d | ||
|
||
This command will launch the frontend and backend applications. By default, the application will be available at: http://localhost:4333/. The ports can be configured in the `docker-compose.yml` file. | ||
|
||
## Build frontend | ||
|
||
$ docker build -t 4gray/iptvnator -f docker/Dockerfile . | ||
|
||
## Build backend | ||
|
||
You can find the backend app with all instructions in a separate GitHub repository - https://github.com/4gray/iptvnator-backend |
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,17 @@ | ||
version: '3' | ||
|
||
services: | ||
backend: | ||
image: 4gray/iptvnator-backend:latest | ||
ports: | ||
- "7333:3000" | ||
environment: | ||
- CLIENT_URL=http://localhost:4333 | ||
|
||
frontend: | ||
image: 4gray/iptvnator:latest | ||
ports: | ||
- "4333:80" #this one should match with the port in CLIENT_URL env | ||
environment: | ||
- BACKEND_PORT=7333 # this one should match with the exposed port of the backend service | ||
|
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,11 @@ | ||
server { | ||
listen 80; | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html =404; | ||
} | ||
|
||
include /etc/nginx/extra-conf.d/*.conf; | ||
} |
4b97e3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
iptvnator – ./
iptvnator-4gray.vercel.app
iptvnator-git-electron-4gray.vercel.app
iptvnator.vercel.app