-
Notifications
You must be signed in to change notification settings - Fork 2
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 #3 from sarthakpranesh/fixingDockerfile
chore: adding docker file, script and little documentation for self hosting
- Loading branch information
Showing
4 changed files
with
37 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 |
---|---|---|
|
@@ -7,4 +7,5 @@ dist | |
# IDEs and editors | ||
.github | ||
.vscode | ||
.vs | ||
.vs | ||
localFileStore |
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,18 +1,30 @@ | ||
################### | ||
# BUILD FOR LOCAL DEVELOPMENT | ||
################### | ||
FROM node:21-alpine3.18 | ||
|
||
FROM node:18-alpine | ||
# get git | ||
RUN apk add --no-cache git bash | ||
|
||
WORKDIR app | ||
WORKDIR /mydraft | ||
|
||
# setup the server | ||
COPY . . | ||
|
||
RUN npm i | ||
RUN echo -e "\nVITE_SERVER_URL=/api" >> ./.env | ||
RUN npm run build | ||
RUN cp ./.env ./dist/ | ||
|
||
EXPOSE 8001 | ||
# setup react app | ||
RUN cd ./dist/ && git clone https://github.com/mydraft-cc/ui.git | ||
|
||
# Start the server using the production build | ||
CMD [ "node", "dist/index.js" ] | ||
RUN cd ./dist/ui && echo "VITE_SERVER_URL=/api" > ./.env | ||
RUN cd ./dist/ui && rm -rf ./package-lock.json | ||
RUN cd ./dist/ui && npm install | ||
RUN cd ./dist/ui && npm run build | ||
|
||
RUN mkdir ./localFileStore | ||
RUN chmod -R a+rw ./localFileStore | ||
|
||
USER node | ||
EXPOSE 8001/tcp | ||
|
||
CMD ["node", "./dist/index.js"] |
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,10 @@ | ||
# Server for mydraft | ||
|
||
Stores the documents in Google Cloud storage and provides a websocket interface for live collaboration over yjs. | ||
|
||
### Self hosting | ||
|
||
``` | ||
docker build -t mydraft/app . | ||
docker run --name mydraft -d -p 8001:8001 -v ${PWD}/localFileStore:/mydraft/localFileStore mydraft/app | ||
``` |
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