forked from 3wordchant/capsul-flask
Initial attempt at Docker
This commit is contained in:
parent
908d02803f
commit
c8ec53f207
14
.drone.yml
Normal file
14
.drone.yml
Normal file
@ -0,0 +1,14 @@
|
||||
---
|
||||
kind: pipeline
|
||||
name: publish docker image
|
||||
steps:
|
||||
- name: build and publish
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_reg_username_3wc
|
||||
password:
|
||||
from_secret: docker_reg_passwd_3wc
|
||||
repo: 3wordchant/capsul-flask
|
||||
tags: latest
|
||||
|
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@ -0,0 +1,26 @@
|
||||
FROM python:3.8-alpine
|
||||
|
||||
RUN apk add gettext git gcc python3-dev musl-dev \
|
||||
libffi-dev zlib-dev jpeg-dev libjpeg postgresql-dev build-base \
|
||||
--virtual .build-dependencies
|
||||
|
||||
RUN mkdir /code
|
||||
WORKDIR /code
|
||||
COPY Pipfile Pipfile.lock /code/
|
||||
|
||||
RUN pip install pipenv setuptools wheel cppy
|
||||
|
||||
RUN pipenv install --system --deploy --verbose
|
||||
|
||||
RUN apk del .build-dependencies \
|
||||
&& rm -rf /var/cache/apk/* /tmp/*
|
||||
|
||||
RUN apk add --no-cache libpq libstdc++ libjpeg
|
||||
|
||||
COPY . /code/
|
||||
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:5000", "-k", "gevent", "--worker-connections", "1000", "app:app"]
|
||||
|
||||
VOLUME /code
|
||||
|
||||
EXPOSE 5000
|
26
docker-compose.yml
Normal file
26
docker-compose.yml
Normal file
@ -0,0 +1,26 @@
|
||||
---
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: 3wordchant/capsul-flask:latest
|
||||
build: .
|
||||
volumes:
|
||||
- "./:/code"
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
|
||||
db:
|
||||
image: "postgres:9.6.5"
|
||||
volumes:
|
||||
- "postgres:/var/lib/postgresql/data"
|
||||
environment:
|
||||
POSTGRES_USER: capsul
|
||||
POSTGRES_PASSWORD: capsul
|
||||
POSTGRES_DB: capsul
|
||||
|
||||
volumes:
|
||||
postgres:
|
Loading…
Reference in New Issue
Block a user