Fruit-laden vines can be on the heavy side, so pick a plastic container. Many are commercially available as flower planters that should work just fine for a cucumber. Ensure the container you choose has good drainage and is at least 1 gallon in size. One cucumber vine will fill one, 1 gallon container.
Cucumbers are warm-season crops and need plenty of sunlight to grow. Overhanging eaves or other buildings may block patio sunlight, so ensure the spot where you hang your cucumbers gets at least six hours of sun per day. Keep in mind that hot sun, shallow roots and limited soil volume will mean extra irrigation. Check the soil in your hanging planter daily, and water when the top 1 inch of soil is dry.
The key to potting soil for a hanging basket is keeping it light. Jeff Rugg with the University of Illinois' Urban Extension recommends a soil-less potting mixture. They are commercially available as premixed blends of peat, perlite, vermiculite, compost, tree bark and other lightweight potting materials. Many have fertilizer beads already added to the mix.
If the potting medium you purchase doesn't have fertilizer already mixed in, Texas A&M's AgriLIFE Extension recommends mixing your own nutrient drench. Dissolve 2 cups of a complete fertilizer, like 10-20-10, 12-24-12 or 8-16-8, in 1 gallon of tap water. This initial mixture is too concentrated to use directly on your cucumbers. Dilute it further by adding 2 tablespoons of the mixture to 1 gallon of water. You can then use this diluted mixture to water your cucumbers whenever they need it.