We describe the design, construction, calibration, and two different applications of a miniature capacitance dilatometer. The device is suitable for thermal expansion and magnetostriction measurements from 300 K down to about 25 mK, with a resolution of 0.02 Å at low temperatures. The main body of the dilatometer is fabricated from a single block of a Be-Cu alloy by electrical discharge milling. This creates an extremely compact high-resolution measuring cell. We have successfully tested and operated dilatometers of this new type with the commonly used physical property measurement system by quantum design, as well as with several other cryogenic refrigeration systems down to 25 mK and in magnetic fields up to 20 T. Here, the capacitance is measured with a commercially available capacitance bridge. Using a piezoelectric rotator from Attocube Systems, the cell can be rotated at T = 25 mK inside of an inner vacuum chamber of 40 mm diameter. The miniaturized design for the one-axis rotation setup allows a rotation of 360°.