Skip to content

Commit db92664

Browse files
authored
Merge pull request #20 from KaratsubaScans/dockerize
Dockerize
2 parents 8a57a49 + c6a6caa commit db92664

File tree

7 files changed

+49
-2
lines changed

7 files changed

+49
-2
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules

.github/workflows/deploy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
name: Deploy Frontend
22
on:
3-
push:
4-
branches: [master]
3+
workflow_dispatch:
54
jobs:
65
deploy-frontend-job:
76
runs-on: ubuntu-latest
@@ -18,6 +17,7 @@ jobs:
1817
KEY: ${{ secrets.SSHKEY }}
1918
script: |
2019
cd /var/www/Carrot
20+
git reset --hard
2121
git pull
2222
export NVM_DIR=~/.nvm
2323
source ~/.nvm/nvm.sh

Dockerfile.develop

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:lts-alpine
2+
WORKDIR /app
3+
COPY package.json ./
4+
COPY package-lock.json ./
5+
RUN npm ci
6+
COPY . ./
7+
EXPOSE 3000
8+
CMD npm start

Dockerfile.prod

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:lts-alpine
2+
WORKDIR /app
3+
ENV PATH /app/node_modules/.bin:$PATH
4+
COPY package.json ./
5+
COPY package-lock.json ./
6+
RUN npm ci
7+
COPY . ./
8+
RUN npm run build
9+
10+
FROM nginx:stable-alpine
11+
COPY --from=build /app/build /usr/share/nginx/html
12+
EXPOSE 80
13+
CMD ["nginx", "-g", "daemon off;"]

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ React webapp that can read zipped manga files from url. Built for KaratsubaScans
44

55
## Running for development
66

7+
Docker:
8+
9+
```
10+
docker-compose up
11+
```
12+
713
Switch to node version 14.17.6 LTS using nvm:
814
```
915
$ nvm install 14.17.6

docker-compose.prod.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: "3.8"
2+
services:
3+
app:
4+
container_name: carrot
5+
restart: always
6+
build:
7+
context: .
8+
dockerfile: Dockerfile.prod
9+
expose:
10+
- 80

docker-compose.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: "3.8"
2+
services:
3+
app:
4+
container_name: carrot-dev
5+
build:
6+
context: .
7+
dockerfile: Dockerfile.develop
8+
ports:
9+
- 3000:3000

0 commit comments

Comments
 (0)