-
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.
- Loading branch information
1 parent
9072508
commit 0213836
Showing
4 changed files
with
40 additions
and
2 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 | ||
|
||
server/public |
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,33 @@ | ||
FROM node:lts-alpine | ||
|
||
WORKDIR /app | ||
|
||
# Copy and install dependencies for the client | ||
COPY client/package*.json ./client/ | ||
RUN npm install --prefix client --omit=dev | ||
|
||
# Copy and install dependencies for the server | ||
COPY server/package*.json ./server/ | ||
RUN npm install --prefix server --omit=dev | ||
|
||
# Copy the rest of the client files and build the client | ||
COPY client/ ./client/ | ||
RUN npm run build --prefix client | ||
|
||
# Copy the server files after the client is built | ||
COPY server/ ./server/ | ||
|
||
# Ensure the server/public directory exists | ||
RUN mkdir -p ./server/public | ||
|
||
# Move the built client files to the server's public directory | ||
RUN cp -R ./client/build/* ./server/public/ | ||
|
||
USER node | ||
|
||
# Start the server | ||
CMD ["npm", "start", "--prefix", "server"] | ||
|
||
# Expose the port | ||
EXPOSE 5000 | ||
|
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