Skip to content

Commit

Permalink
Admin docker (#108)
Browse files Browse the repository at this point in the history
* Обновил конфиг для production

* admin-docker

* fix homepage

* new github ci/cd

* раскрыл пароль

---------

Co-authored-by: afdavletkulov <afdavletkulov@rttv.ru>
  • Loading branch information
DavletkulovAynur and afdavletkulov authored Nov 3, 2023
1 parent 28a4d0d commit 6e59749
Show file tree
Hide file tree
Showing 10 changed files with 3,605 additions and 20,466 deletions.
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

0 comments on commit 6e59749

Please sign in to comment.