-
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
64b35c8
commit d2509a8
Showing
3 changed files
with
54 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,24 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Docker | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Build Docker image | ||
run: docker build -t my-nextjs-app -f Dockerfile . | ||
|
||
- name: Run Docker container | ||
run: docker run -d --name nextjs-container -p 3000:3000 my-nextjs-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Use the official Node.js image as a base image | ||
FROM node:20 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy package.json and yarn.lock into the working directory | ||
COPY package.json yarn.lock ./ | ||
|
||
# Install dependencies | ||
RUN yarn install --frozen-lockfile | ||
|
||
# Copy the source code and other necessary files/directories | ||
COPY . . | ||
|
||
# Build the Next.js app | ||
RUN yarn build | ||
|
||
# Expose the port the app runs on | ||
EXPOSE 3000 | ||
|
||
# Start the app | ||
CMD ["yarn", "start"] |
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,7 @@ | ||
version: "3.6" | ||
|
||
services: | ||
chatgpt: | ||
build: . | ||
ports: | ||
- 3000:3000 |