Skip to content

Commit ca49390

Browse files
committed
contanerized application
Signed-off-by: Oluwasomidotun <[email protected]>
1 parent 71e21a6 commit ca49390

File tree

4 files changed

+60
-0
lines changed

4 files changed

+60
-0
lines changed

.dockerignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
3+
npm-debug.log
4+
5+
Dockerfile
6+
7+
.dockerignore
8+
9+
.env
10+

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,7 @@ dist
128128
.yarn/build-state.yml
129129
.yarn/install-state.gz
130130
.pnp.*
131+
132+
# idea
133+
134+
./.idea

Dockerfile

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:18
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY package.json package-lock.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
EXPOSE 3000
12+
13+
CMD ["node", "src/server.js"]

docker-compose.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
version: "3.8"
2+
3+
services:
4+
afos-api:
5+
build:
6+
context: .
7+
dockerfile: Dockerfile
8+
ports:
9+
- 3000:3000
10+
volumes:
11+
- .:/src
12+
environment:
13+
- NODE_ENV=production
14+
- PORT=3000
15+
- DB_HOST=mysql
16+
- DB_USER=afos
17+
- DB_PASSWORD=afosS3cure!Passw@rd
18+
- DB_NAME=afosdb
19+
- JWT_SECRET=afos-secret
20+
depends_on:
21+
- mysql
22+
23+
mysql:
24+
image: mysql:8.0
25+
container_name: mysql-container
26+
environment:
27+
MYSQL_ROOT_PASSWORD: passw@rd
28+
MYSQL_DATABASE: afosdb
29+
volumes:
30+
- mysql_data:/var/lib/mysql
31+
32+
volumes:
33+
mysql_data:

0 commit comments

Comments
 (0)