-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup docker and docker compose for both services.
- Loading branch information
Showing
5 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
services: | ||
product-api: | ||
build: | ||
context: ./src/product_api | ||
dockerfile: Dockerfile | ||
container_name: product-api | ||
volumes: | ||
- ./src/product_api:/usr/src/app | ||
- ./src/product_api/src/eshop.db:/usr/src/app/src/eshop.db | ||
ports: | ||
- "8000:8000" | ||
environment: | ||
- DEBUG=True | ||
command: uvicorn src.app:app --host 0.0.0.0 --port 8000 --reload | ||
|
||
web: | ||
build: | ||
context: ./src/web | ||
dockerfile: Dockerfile | ||
container_name: angular-web | ||
volumes: | ||
- ./src/web:/usr/src/app | ||
- /usr/src/app/node_modules | ||
ports: | ||
- "4200:4200" | ||
depends_on: | ||
- product-api | ||
command: ng serve --host 0.0.0.0 --port 4200 | ||
|
||
volumes: | ||
sqlite_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM python:3.12.4-alpine | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
RUN apk update && \ | ||
apk add --no-cache --virtual .build-deps \ | ||
gcc python3-dev musl-dev ca-certificates libffi-dev | ||
|
||
COPY requirements.txt ./ | ||
|
||
RUN pip install --upgrade pip | ||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
COPY . . | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["uvicorn", "src.app:app", "--host", "0.0.0.0", "--port", "8000"] |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install | ||
|
||
RUN npm install -g @angular/cli | ||
|
||
COPY . . | ||
|
||
EXPOSE 4200 | ||
|
||
CMD ["ng", "serve", "--host", "0.0.0.0"] |