-
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.
Added required files for Docker image build with GitHub Actions
- Loading branch information
1 parent
e1bde1b
commit b0c5f9f
Showing
4 changed files
with
63 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,10 @@ | ||
**/*.md | ||
**/.git* | ||
**/.dockerignore | ||
**/.editorconfig | ||
**/.gitattributes | ||
**/node_modules | ||
**/Dockerfile | ||
**/docker-* | ||
**/CODEOWNERS | ||
**/LICENSE |
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,26 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Use an customized image of Node.js | ||
# https://hub.docker.com/_/node | ||
FROM node:lts-alpine | ||
|
||
# Set the working directory to the website files | ||
WORKDIR /usr/src/app | ||
|
||
# Change permissions of the working directory | ||
RUN chown node:node . | ||
|
||
# Copy all files required to build the project | ||
COPY --chown=node:node . . | ||
|
||
# Install all dependencies | ||
# Use cache mount to speed up installation of existing dependencies | ||
RUN --mount=type=cache,target=.npm \ | ||
npm set cache .npm && \ | ||
npm install && chown -R node:node ./node_modules | ||
|
||
# Use non-root user | ||
USER node | ||
|
||
# Run the website | ||
CMD [ "npm", "run", "dev", "--", "--host", "0.0.0.0" ] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: homepage | ||
|
||
services: | ||
# https://github.com/FlorianLeChat/Homepage | ||
node: | ||
image: homepage | ||
restart: always | ||
develop: | ||
watch: | ||
- action: sync | ||
path: . | ||
target: /usr/src/app | ||
healthcheck: | ||
test: wget --no-check-certificate -O - https://127.0.0.1:5173 | ||
retries: 3 | ||
timeout: 5s | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
ports: | ||
- "5173:5173" |