generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Live reload and SCSS compliation working in Docker Image
- Loading branch information
Joshua Fishman
committed
Oct 9, 2024
1 parent
0a7cc05
commit ccb7d05
Showing
17 changed files
with
536 additions
and
1,021 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 |
---|---|---|
@@ -1,20 +1,44 @@ | ||
# Start with a Python base image | ||
FROM python:3.8-slim | ||
FROM squidfunk/mkdocs-material | ||
|
||
# Set a working directory | ||
WORKDIR /app | ||
#COPY . /app | ||
|
||
# Copy the requirements.txt file into the image | ||
COPY requirements.txt /app/ | ||
RUN apk add --no-cache nodejs npm | ||
|
||
# Install the Python dependencies | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
WORKDIR /docs | ||
|
||
# Copy the rest of your MkDocs site source code into the image | ||
COPY . /app/ | ||
COPY package.json . | ||
RUN npm install | ||
|
||
|
||
COPY requirements.txt . | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY . . | ||
|
||
# Expose the port MkDocs will run on | ||
EXPOSE 8000 | ||
EXPOSE 8000 35729 | ||
|
||
|
||
# Create a startup script | ||
RUN echo '#!/bin/sh' > /start.sh && \ | ||
echo 'npm run watch-sass &' >> /start.sh && \ | ||
echo 'mkdocs serve --dev-addr 0.0.0.0:8000' >> /start.sh && \ | ||
chmod +x /start.sh | ||
|
||
# Set the startup script as the entry point | ||
ENTRYPOINT ["/start.sh"] | ||
|
||
# Run MkDocs serve command | ||
CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"] | ||
# CMD ["mkdocs", "serve", "--dev-addr=0.0.0.0:8000"] | ||
|
||
# Command to run both SCSS watcher and MkDocs serve concurrently | ||
#CMD ["concurrently", | ||
# "\"sass --watch components/sass/main.scss:components/sass/main.css\"", | ||
# "\"mkdocs serve --dev-addr=0.0.0.0:8000\""] | ||
|
||
#CMD ["concurrently", | ||
# "\"/usr/local/bin/sass --watch docs/components/sass/main.scss:docs/components/sass/main.css\"", | ||
# "\"mkdocs serve --dev-addr=0.0.0.0:8000\"", | ||
# "\"python -m livereload docs -p 35729 -w docs\""] |
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 @@ | ||
.btn-grid-3{display:grid;grid-template-columns:repeat(3, 1fr);text-align:center}.grid-items{border:1px solid #ccc;padding:20px;display:flex;align-content:center;justify-content:center}/*# sourceMappingURL=grid.css.map */ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
version: '3.9' | ||
services: | ||
mkdocs: | ||
image: squidfunk/mkdocs-material | ||
volumes: | ||
- .:/docs | ||
- .:/node_modules # Persist node_modules for faster subsequent builds | ||
stdin_open: true | ||
tty: true | ||
command: mkdocs serve --dev-addr=0.0.0.0:8000 |
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.