Docker image, & local development docker-compose.yml #2
25
Dockerfile
25
Dockerfile
@ -1,8 +1,17 @@
|
||||
FROM python:3.8-alpine as build
|
||||
|
||||
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 apk add --no-cache \
|
||||
3wordchant marked this conversation as resolved
Outdated
|
||||
build-base \
|
||||
gcc \
|
||||
gettext \
|
||||
git \
|
||||
jpeg-dev \
|
||||
libffi-dev \
|
||||
libjpeg \
|
||||
musl-dev \
|
||||
postgresql-dev \
|
||||
python3-dev \
|
||||
zlib-dev
|
||||
|
||||
RUN mkdir -p /app/{code,venv}
|
||||
WORKDIR /app/code
|
||||
@ -17,8 +26,14 @@ RUN pipenv install --deploy --verbose
|
||||
|
||||
FROM python:3.8-alpine
|
||||
|
||||
RUN apk add --no-cache libpq libstdc++ libjpeg virt-install libvirt-client \
|
||||
cloud-utils openssh-client
|
||||
RUN apk add --no-cache \
|
||||
cloud-utils \
|
||||
libjpeg \
|
||||
libpq \
|
||||
libstdc++ \
|
||||
libvirt-client \
|
||||
openssh-client \
|
||||
virt-install
|
||||
|
||||
COPY . /app/code/
|
||||
WORKDIR /app/code
|
||||
|
@ -33,7 +33,7 @@ for var_name in [
|
||||
"SPOKE_HOST_TOKEN", "HUB_TOKEN", "STRIPE_SECRET_KEY",
|
||||
"BTCPAY_PRIVATE_KEY", "MAIL_PASSWORD"
|
||||
]:
|
||||
var = os.environ.get(f"{var_name}_FILE", False)
|
||||
var = os.environ.get(f"{var_name}_FILE")
|
||||
3wordchant marked this conversation as resolved
Outdated
decentral1se
commented
Optional: Optional: `var = os.environ.get(f"{var_name}_FILE")` also works as it defaults to `None` if missing.
|
||||
if not var:
|
||||
continue
|
||||
|
||||
|
@ -26,7 +26,7 @@ services:
|
||||
devices:
|
||||
- "/dev/kvm:/dev/kvm"
|
||||
db:
|
||||
image: "postgres:9.6.5"
|
||||
image: "postgres:9.6.5-alpine"
|
||||
3wordchant marked this conversation as resolved
Outdated
decentral1se
commented
Maybe Maybe `postgres:9.6-alpine` as it is smaller? https://hub.docker.com/_/postgres?tab=description&page=1&ordering=last_updated
|
||||
volumes:
|
||||
- "postgres:/var/lib/postgresql/data"
|
||||
environment:
|
||||
|
Loading…
Reference in New Issue
Block a user
Feel free to ignore but I usually add
--no-cache
to save space and newline + sort things so it is easier to have a visual overview of dependencies and alphabetic ordering to know where to slot things in. Can be useful if you end up adding a lot of dependencies and then need to remove them over time as the software changes.