Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin docker #108

Merged
merged 6 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
*~
.DS_Store
.svn
.hg
.git
node_modules
Dockerfile
Dockerfile.production
build
.vscode
.idea
8 changes: 7 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
SKIP_PREFLIGHT_CHECK=true
SKIP_PREFLIGHT_CHECK=true
REACT_APP_FIREBASE_API_KEY = AIzaSyDSTgkitTSUvEUEA_Bp21yjbjzgCRc9gf0
REACT_APP_FIREBASE_AUTH_DOMAIN = yul-yort-admin.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID = yul-yort-admin
REACT_APP_FIREBASE_STORAGE_BUCKET = yul-yort-admin.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID = 845624548697
REACT_APP_FIREBASE_APP_ID = 1:845624548697:web:d6ab0c6300b3a046570048
29 changes: 29 additions & 0 deletions .github/workflows/push_to_main_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: CI/CD to Docker Hub

on:
push:
branches:
- main

jobs:
push_to_registry:
name: Push Docker image to Docker hub
runs-on: ubuntu-latest

steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.production
push: true
tags: davletkulov/yul-yort-admin:latest
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20-alpine

WORKDIR /app

COPY ["package.json", "package-lock.json*", "./"]

RUN npm install

COPY . .

ENV PORT 3000

EXPOSE $3000

CMD ["npm", "start"]
14 changes: 14 additions & 0 deletions Dockerfile.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:20-alpine AS build

WORKDIR /app

COPY ["package.json", "package-lock.json*", "./"]

RUN npm install

ENV NODE_ENV=production

COPY . .

RUN npm run build

10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: "3"

services:
admin:
restart: always
build: .
ports:
- "4000:3000"
volumes:
- ./src/:/app/src
Loading
Loading