Merge 3710f3bd72
into 13386236e4
This commit is contained in:
commit
97460a0d74
7
app/Dockerfile
Normal file
7
app/Dockerfile
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# syntax=docker/dockerfile:1
|
||||||
|
FROM node:12-alpine
|
||||||
|
RUN apk add --no-cache python g++ make
|
||||||
|
WORKDIR /app
|
||||||
|
COPY . .
|
||||||
|
RUN yarn install --production
|
||||||
|
CMD ["node", "src/index.js"]
|
@ -52,8 +52,8 @@ function TodoListCard() {
|
|||||||
return (
|
return (
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
<AddItemForm onNewItem={onNewItem} />
|
<AddItemForm onNewItem={onNewItem} />
|
||||||
{items.length === 0 && (
|
{items.length === 0 && (
|
||||||
<p className="text-center">No items yet! Add one above!</p>
|
<p className="text-center">You have no todo items yet! Add one above!</p>
|
||||||
)}
|
)}
|
||||||
{items.map(item => (
|
{items.map(item => (
|
||||||
<ItemDisplay
|
<ItemDisplay
|
||||||
|
@ -1,12 +1,27 @@
|
|||||||
version: "3.7"
|
version: "3.7"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
docs:
|
app:
|
||||||
build:
|
image: node:12-alpine
|
||||||
context: .
|
command: sh -c "yarn install && yarn run dev"
|
||||||
dockerfile: Dockerfile
|
|
||||||
target: dev
|
|
||||||
ports:
|
ports:
|
||||||
- 8000:8000
|
- 3000:3000
|
||||||
|
working_dir: /app
|
||||||
volumes:
|
volumes:
|
||||||
- ./:/app
|
- ./:/app
|
||||||
|
environment:
|
||||||
|
MYSQL_HOST: mysql
|
||||||
|
MYSQL_USER: root
|
||||||
|
MYSQL_PASSWORD: secret
|
||||||
|
MYSQL_DB: todos
|
||||||
|
|
||||||
|
mysql:
|
||||||
|
image: mysql:5.7
|
||||||
|
volumes:
|
||||||
|
- todo-mysql-data:/var/lib/mysql
|
||||||
|
environment:
|
||||||
|
MYSQL_ROOT_PASSWORD: secret
|
||||||
|
MYSQL_DATABASE: todos
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
todo-mysql-data:
|
Loading…
Reference in New Issue
Block a user