Skip to content

Commit 2c05465

Browse files
NishaNisha
Nisha
authored and
Nisha
committed
📦 NEW: Add Docker configruation
1 parent 1a277d7 commit 2c05465

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

‎.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/node_modules
2+
**/build
3+
.dockerignore
4+
Dockerfile-ui
5+
Dockerfile-api
6+
dbsamples-0.1
7+
*.md

‎Dockerfile-api

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Installing backend Django
2+
FROM python:3
3+
ENV PYTHONUNBUFFERED=1
4+
RUN mkdir /code
5+
WORKDIR /code
6+
COPY requirements.txt /code/
7+
RUN pip install -r requirements.txt
8+
COPY . /code/

‎Dockerfile-ui

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Installing UI
2+
FROM node:13.12.0-alpine
3+
WORKDIR /app
4+
COPY ./ui/package.json /app
5+
RUN npm install --silent
6+
COPY ./ui /app
7+
CMD ["npm", "start"]

‎docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
version: "3.6"
2+
3+
4+
services:
5+
db:
6+
image: 'postgres'
7+
ports:
8+
- '5432'
9+
networks:
10+
some_network:
11+
environment:
12+
- POSTGRES_DB=postgres
13+
- POSTGRES_USER=postgres
14+
- POSTGRES_PASSWORD=postgres
15+
core:
16+
build:
17+
context: .
18+
dockerfile: Dockerfile-api
19+
command: python manage.py runserver 0.0.0.0:8000
20+
ports:
21+
- '8000:8000'
22+
volumes:
23+
- .:/code
24+
depends_on:
25+
- db
26+
links:
27+
- db:db
28+
networks:
29+
some_network:
30+
31+
client:
32+
stdin_open: true
33+
container_name: world-api-ui
34+
build:
35+
context: .
36+
dockerfile: Dockerfile-ui
37+
ports:
38+
- "3000:3000"
39+
volumes:
40+
- "/app/node_modules"
41+
- "./ui/:/app"
42+
43+
networks:
44+
some_network:

0 commit comments

Comments
 (0)