generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create ci/cd for vite dev environment
- Loading branch information
1 parent
05ae319
commit ffef220
Showing
10 changed files
with
55 additions
and
115 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,2 @@ | ||
node_modules | ||
.npm |
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,4 @@ | ||
frontend/static | ||
frontend/templates | ||
node_modules | ||
node_modules | ||
dist/ |
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,29 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:20.11.1-bullseye AS build | ||
|
||
# # Specify working directory other than / | ||
WORKDIR /usr/src/app | ||
|
||
# # Copy only files required to install | ||
# # dependencies (better layer caching) | ||
COPY package*.json ./ | ||
|
||
# # Use cache mount to speed up install of existing dependencies | ||
RUN --mount=type=cache,target=/usr/src/app/.npm \ | ||
npm set cache /usr/src/app/.npm && \ | ||
npm install | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
# # Use separate stage for deployable image | ||
FROM nginxinc/nginx-unprivileged:1.23-alpine-perl | ||
|
||
# # Use COPY --link to avoid breaking cache if we change the second stage base image | ||
COPY --link nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
COPY --link --from=build usr/src/app/dist/ /usr/share/nginx/html | ||
|
||
EXPOSE 8080 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
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,20 @@ | ||
server { | ||
listen 8080; | ||
|
||
# Docker internal dns server | ||
resolver 127.0.0.11; | ||
|
||
location /ping { | ||
access_log off; | ||
add_header 'Content-Type' 'text/plain'; | ||
return 200 "pong"; | ||
} | ||
|
||
location / { | ||
root /usr/share/nginx/html; | ||
index src/templates/vite-index.html; | ||
try_files $uri $uri/ src/templates/vite-index.html; | ||
} | ||
|
||
include /etc/nginx/extra-conf.d/*.conf; | ||
} |
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