diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 000000000..c5ee1c048 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,25 @@ +services: + app: + image: node:18-alpine + command: sh -c "yarn install && yarn run dev" + ports: + - 127.0.0.1:3000:3000 + working_dir: /app + volumes: + - ./:/app + environment: + MYSQL_HOST: mysql + MYSQL_USER: root + MYSQL_PASSWORD: secret + MYSQL_DB: todos + + mysql: + image: mysql:8.0 + volumes: + - todo-mysql-data:/var/lib/mysql + environment: + MYSQL_ROOT_PASSWORD: secret + MYSQL_DATABASE: todos + +volumes: + todo-mysql-data: diff --git a/dockerfile b/dockerfile new file mode 100644 index 000000000..b6a70bac0 --- /dev/null +++ b/dockerfile @@ -0,0 +1,6 @@ +FROM node:lts-alpine +WORKDIR /app +COPY package.json yarn.lock ./ +RUN yarn install --production +COPY . . +CMD ["node", "src/index.js"] diff --git a/greeting.txt b/greeting.txt new file mode 100644 index 000000000..425286d21 --- /dev/null +++ b/greeting.txt @@ -0,0 +1 @@ +This is the apline container diff --git a/src/static/index.html b/src/static/index.html index 3f6fb5be0..99810c874 100644 --- a/src/static/index.html +++ b/src/static/index.html @@ -8,7 +8,7 @@ -
No items yet! Add one above!
+You have no todo items yet!! Add one above!
)} {items.map(item => (