I would recommend that you use an ultrasonic sensor placed at the top of the container to measure the water level relative to the top of the container then you may subtract that from the overall height of the container to find the true water level.
Now to do this you would want to start off by selecting an ultrasonic sensor, I would personally recommend the HC-SR04 ultrasonic sensor because of its cost effectiveness and reliability. The sensor chosen should be mounted to the top of your container the container does not have a top then you should be ok, but if it does you will likely want to just drill 1 or 2 holes depending on your sensor type and have it mounted on top of the container to prevent humidity from rusting out the sensors circuits or worse creating a short circuit.
After you have the sensor mounted you will want to wire it up to the pi, depending on the sensor you have you may need a different circuit to connect it but for the one that I have recommended above, the instructions for connecting it are included below.
The HC-SR04 ultrasonic sensor has four pins ground, Echo, Trigger, and 5 volt in. The ground pin should be connected to the ground on your raspberry pi which is pin 6, now there are multiple ground's and 5volt lines on the pi and it really does not matter which one you choose to use. Now connect the 5 volt supply on the sensor to a 5 volt GPIO pin on your pi such as GPIO pin 2. Now connect the trigger pin on your sensor to a GPIO pin on the pi of your choice. Now since the sensor that we have chosen to use uses 5 volt logic but our pi's gpio pins will only accept 3.3 we will have to step-down the echo pins voltage but should be ok for the trigger as 3v3 should be enough to set the sensor off. Now for the echo pin on the sensor you will want to put a 1k resistor between the pin and a GPIO pin of your choosing on the pi, and the connect the same GPIO pin that you have just chosen to a 2k resistor and the other end of that resistor to a ground pin on your pi effectively creating a voltage divider.
Now onto software below is an example script on how water level would be measured.
import RPI.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
triggerPin=1;#enter the gpio pin that you are using for the trigger here
echoPin=2;#enter the gpio pin that you are using for the echo here
## now setup the gpio pins as an input and an output
GPIO.setup(triggerPin,GPIO.OUT)
GPIO.setup(echoPin,GPIO.IN)
#now ensure that the trigger pin output is set to low and give the sensor a second to ensure that you do not get false positives
GPIO.output(triggerPin, False)
time.sleep(2)
## now after sleeping for 2 seconds we want to run our trigger pin for the amount of time stated on the sensors manual which for the HC-SRo4 is 1 ten thousandths of a second
GPIO.output(triggerPin, True)
time.sleep(0.00001)
GPIO.output(triggerPin, False)
## now we want to start a timer to measure how long the response took
while GPIO.input(echoPin)==0:
pulse_start_timer=time.time()
while GPIO.input(echoPin)==1:
pulse_end_timer=time.time()
pulse_duration=pulse_end-pulse_start
## now we want to multiply this value by the aproxamete speed of sound which is 34300 cm but divide that by two because our ultrasonic sensor is measuring the time taken both ways but we only want one.
distance_from_top=pulse_duration*17150
## now we want to subtract the above number from the height of our container
bin_height=100## in cm
distance_from_bottom=bin_height-distance_from_top
print distance_from_bottom
GPIO.cleanup()