Skip to content

Commit

Permalink
contanerized application
Browse files Browse the repository at this point in the history
Signed-off-by: Oluwasomidotun <[email protected]>
  • Loading branch information
dotunv committed Dec 7, 2024
1 parent 71e21a6 commit ca49390
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
node_modules

npm-debug.log

Dockerfile

.dockerignore

.env

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,7 @@ dist
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# idea

./.idea
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM node:18

WORKDIR /usr/src/app

COPY package.json package-lock.json ./

RUN npm install

COPY . .

EXPOSE 3000

CMD ["node", "src/server.js"]
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: "3.8"

services:
afos-api:
build:
context: .
dockerfile: Dockerfile
ports:
- 3000:3000
volumes:
- .:/src
environment:
- NODE_ENV=production
- PORT=3000
- DB_HOST=mysql
- DB_USER=afos
- DB_PASSWORD=afosS3cure!Passw@rd
- DB_NAME=afosdb
- JWT_SECRET=afos-secret
depends_on:
- mysql

mysql:
image: mysql:8.0
container_name: mysql-container
environment:
MYSQL_ROOT_PASSWORD: passw@rd
MYSQL_DATABASE: afosdb
volumes:
- mysql_data:/var/lib/mysql

volumes:
mysql_data:

0 comments on commit ca49390

Please sign in to comment.