mirror of
https://github.com/NeonGamerBot-QK/saahild.com.git
synced 2025-04-03 18:14:14 +00:00
feat: docker
This commit is contained in:
parent
f13a6860f4
commit
896d91a6c0
4 changed files with 46 additions and 0 deletions
3
.dockerignore
Normal file
3
.dockerignore
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
node_modules
|
||||||
|
.github
|
||||||
|
scripts
|
22
.github/workflows/build-docker.yml
vendored
Normal file
22
.github/workflows/build-docker.yml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
name: publish
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "main"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish-docker-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v1
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.MY_TOKEN }}
|
||||||
|
- name: Build the Docker image
|
||||||
|
run: |
|
||||||
|
docker build . --tag ghcr.io/neongamerbot-qk/saahildcom:latest
|
||||||
|
docker push ghcr.io/neongamerbot-qk/saahildcom:latest
|
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
FROM node:20-alpine as builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package*.json .
|
||||||
|
COPY yarn*.lock .
|
||||||
|
RUN yarn install
|
||||||
|
COPY . .
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
#Stage 2
|
||||||
|
FROM nginx:1.19.0
|
||||||
|
WORKDIR /usr/share/nginx/html
|
||||||
|
RUN rm -rf ./*
|
||||||
|
COPY --from=builder /app/build .
|
||||||
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
7
docker-compose.yml
Normal file
7
docker-compose.yml
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
name: <your project name>
|
||||||
|
services:
|
||||||
|
<to-change-here>:
|
||||||
|
ports:
|
||||||
|
- 3000:80
|
||||||
|
container_name: saahildcom
|
||||||
|
image: <to-change-here>:latest
|
Loading…
Add table
Reference in a new issue