Skip to content

Commit a66a7e3

Browse files
committed
fix: execute docker
1 parent 9c789b1 commit a66a7e3

File tree

10 files changed

+32
-28
lines changed

10 files changed

+32
-28
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM node:14-slim
2+
WORKDIR /app
3+
4+
COPY . .
5+
6+
RUN yarn

cypress.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const { defineConfig } = require('cypress');
2+
3+
module.exports = defineConfig({
4+
e2e: {
5+
baseUrl: 'http://localhost:3000',
6+
},
7+
});

docker-compose.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
version: '3.7'
2-
31
services:
42
web:
53
container_name: password-generator-web
64
build:
75
context: .
86
dockerfile: docker/app.dockerfile
7+
ports:
8+
- '3000:3000'
99
environment:
1010
- PORT=3000
1111
- NODE_ENV=development
12-
- CHOKIDAR_USEPOLLING=true
12+
volumes:
13+
- .:/app
14+
restart: always
1315
network_mode: host
1416
stdin_open: true
1517
command: yarn start

docker/app.dockerfile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
FROM node:14-slim
2-
32
WORKDIR /app
43

5-
ENV PATH /app/node_modules/.bin:$PATH
6-
7-
COPY . ./
4+
COPY . .
85

9-
RUN yarn install
6+
RUN yarn

docker/e2e.dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
FROM cypress/base
2-
1+
FROM cypress/base:16
32
WORKDIR /app
43

54
COPY cypress.json ./
5+
COPY package.json .
66

7-
RUN npx cypress verify
7+
RUN yarn
8+
RUN npx cypress verify

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"dependencies": {
66
"@password-generator/check-strength": "^2.0.4",
77
"@password-generator/package": "latest",
8+
"cypress": "5.0.0",
89
"polished": "^3.6.7",
910
"react": "^16.13.1",
1011
"react-dom": "^16.13.1",
@@ -24,7 +25,6 @@
2425
"@typescript-eslint/eslint-plugin": "^3.9.0",
2526
"@typescript-eslint/parser": "^3.9.0",
2627
"commitizen": "^4.1.2",
27-
"cypress": "5.0.0",
2828
"cz-conventional-changelog": "^3.2.0",
2929
"eslint": "^6.6.0",
3030
"eslint-config-airbnb": "^18.2.0",

scripts/docker-compose-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker-compose build
1+
docker compose build

scripts/run-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
docker-compose run e2e
1+
docker compose run e2e

scripts/start-server.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
docker-compose up -d web
2-
echo 'server running on http://localhost:3000'
1+
docker compose up -d web
2+
echo 'server running on http://localhost:3000'

tsconfig.json

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
9-
"types": [
10-
"cypress"
11-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
5+
"types": ["cypress"],
126
"allowJs": true,
137
"skipLibCheck": true,
148
"esModuleInterop": true,
@@ -22,8 +16,5 @@
2216
"jsx": "react",
2317
"isolatedModules": true
2418
},
25-
"include": [
26-
"src",
27-
"cypress"
28-
]
19+
"include": ["src/**/*", "cypress/**/*"]
2920
}

0 commit comments

Comments
 (0)