Added Send mail functionality & Dockerized application #1
17
Dockerfile
Normal file
17
Dockerfile
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# pull official base image
|
||||||
|
FROM python:3.9.6-alpine
|
||||||
|
|
||||||
|
# set work directory
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# set environment variables
|
||||||
|
ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
# install dependencies
|
||||||
|
RUN pip install --upgrade pip
|
||||||
|
COPY ./requirements.txt .
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
# copy project
|
||||||
|
COPY . .
|
||||||
PeterSurda marked this conversation as resolved
Outdated
|
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
web:
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
`smtp-gateway:`
|
|||||||
|
build: .
|
||||||
|
command: python main.py
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
perhaps this should be inside the perhaps this should be inside the `Dockerfile`
|
|||||||
|
volumes:
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
If we only use this internally inside a docker service, we should use If we only use this internally inside a docker service, we should use `expose`, not `port`.
|
|||||||
|
- mailsend_server:/usr/src/app/
|
||||||
|
ports:
|
||||||
|
- 8081:8081
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
wrong file wrong file
|
|||||||
|
env_file:
|
||||||
|
- ./config.ini
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
`env_file` is for shell variables, it won't work in this case. Instead we need a simple `entrypoint.sh` which will for example format the `config.ini`
|
|||||||
|
|
||||||
|
volumes:
|
||||||
|
mailsend_server:
|
||||||
PeterSurda marked this conversation as resolved
Outdated
PeterSurda
commented
we don't need a volume, the app will already be inside the dockerfile we don't need a volume, the app will already be inside the dockerfile
|
Loading…
Reference in New Issue
Block a user
let's call it something else