forked from evgeny-nadymov/telegram-react
-
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.
Add a Dockerfile to allow running Telegram-React inside a container
- Loading branch information
1 parent
6bbfe23
commit d49112f
Showing
3 changed files
with
44 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,5 @@ | ||
.git | ||
node_modules | ||
.env | ||
.idea | ||
Dockerfile |
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,27 @@ | ||
FROM node:14 AS build | ||
|
||
WORKDIR /app/ | ||
|
||
# Copy over package.json and package-lock.json and install dependencies first, | ||
# so that we don't need to re-download dependencies if they have not been modified. | ||
COPY package.json package-lock.json ./ | ||
RUN npm ci | ||
|
||
COPY . . | ||
RUN cp -v node_modules/tdweb/dist/* public/ | ||
|
||
ARG TELEGRAM_API_ID | ||
ENV REACT_APP_TELEGRAM_API_ID=${TELEGRAM_API_ID} | ||
ARG TELEGRAM_API_HASH | ||
ENV REACT_APP_TELEGRAM_API_HASH=${TELEGRAM_API_HASH} | ||
|
||
RUN npm run build | ||
|
||
FROM nginx:stable | ||
|
||
WORKDIR /usr/share/nginx/html/ | ||
COPY --from=build /app/build/ . | ||
|
||
# Hack to get around the hardcoded folder structure without requiring the user to | ||
# go to /telegram-react in their browser | ||
RUN ln -s . telegram-react |
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