Skip to content

Commit

Permalink
update docker python to 3.10 (#684)
Browse files Browse the repository at this point in the history
also smaller image size at 1.2GB instead of 1.8GB by switching to python-slim
  • Loading branch information
wakamex authored Jul 19, 2023
1 parent eccd788 commit 5a866e7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
### Migrations Image ###
# pinned to a specific image chosen from https://github.com/delvtech/hyperdrive/pkgs/container/hyperdrive%2Fmigrations
FROM ghcr.io/delvtech/hyperdrive/migrations:0.0.4 as migrations
# pinned to a specific image chosen from https://github.com/delvtech/hyperdrive/pkgs/container/hyperdrive%2Fdevnet
FROM ghcr.io/delvtech/hyperdrive/devnet:0.0.8 as migrations

# ### Python Image ###
FROM python:3.9.16-bullseye

# set bash as default shell
SHELL ["/bin/bash", "-c"]
FROM python:3.10-slim

WORKDIR /app

# copy everything in elf-simulations
COPY . ./

# install elfpy
RUN python -m pip install --no-cache-dir --upgrade pip
RUN python -m pip install --no-cache-dir -e ."[with-dependencies,ape]"
# install elfpy in one step, adding build tools, then removing them
# https://stackoverflow.com/questions/58300046/how-to-make-lightweight-docker-image-for-python-app-with-pipenv
RUN python -m pip install --no-cache-dir --upgrade pip && \
apt-get update && \
apt-get install -y --no-install-recommends gcc python3-dev libssl-dev git && \
python -m pip install --no-cache-dir -e ."[with-dependencies,ape]" && \
apt-get remove -y gcc python3-dev libssl-dev && \
apt-get autoremove -y && \
pip uninstall pipenv -y

# copy hyperdrive contracts from migrations image
COPY --from=migrations /src/ ./hyperdrive_solidity/
Expand Down

0 comments on commit 5a866e7

Please sign in to comment.