In September 1922, Petrakovsky joined the Red Army. He served in the 3rd Rifle Regiment of the Separate Caucasian Red Banner Army. In October 1923, he was sent to the Vladikavkaz Red Commanders Infantry Courses, from which he graduated in 1924. In April, he became a sergeant in the 13th Rifle Division's 39th Rifle Regiment at Derbent. In September, he was sent to the Vladikavkaz Infantry Officer School and graduated in 1927. In September, Petrakovsky returned to the regiment and became a sergeant, platoon commander, assistant to company political officer, head of food procurement and senior battalion adjutant. In 1932, he joined the Communist Party of the Soviet Union. He finally became a battalion commander in the division's 27th Rifle Regiment.
Petrakovsky was transferred to become a battalion commander in the 138th Rifle Division's 554th Rifle Regiment. On 11 February 1940, during the Winter War with Finland, his battalion broke through two lines of barbed wire in the area 1.5 kilometers west of Hawtin. The battalion then captured the Finnish trenches and reportedly repulsed five counterattacks. Petrakovsky was promoted to command of the division's 768th Rifle Regiment soon after. On 21 March 1940, he was awarded the title Hero of the Soviet Union and the Order of Lenin for his leadership of the battalion. In July 1940, Petrakovsky was sent to the Frunze Military Academy. On 20 August, Petrakovsky received the information that he was to command the 395th Rifle Division, then forming at Voroshilovgrad. Bad weather delayed his flight to Kharkov to 22 August. The 395th personnel were originally Donbass coal miners. Petrakovsky finished assembling the division by October. The division fought in the defence of Mariupol and the Battle of Rostov in the subsequent months. On 9 April 1942, he was awarded the Order of the Red Banner. Petrakovsky received the award again on 5 May. During the summer of 1942, the division fought in the Battle of Voronezh. On 21 July, Petrakovsky received a promotion to major general. He was soon relieved of command due to "failure to comply with orders of the commander of the 18th Army". In August 1942, Petrakovsky became commander of an operational group of the North Caucasian Front. In September, he became deputy commander of the 47th Army. In November, he became commander of the Tuapse Defence Area. During the fall of 1942, Petrakovsky's command helped block the road through the Pyatigorsk Pass. In February 1943, he became the deputy commander of 18th Army and fought in the Krasnodar Offensive. Between June and July, he led the 317th Rifle Division and participated in fighting on the Taman Peninsula. In August 1943, Petrakovsky was appointed commander of the 57th Rifle Corps and fought in the Battle of the Dnieper and the Lower Dnieper Offensive. On 18 January 1944, he was relieved of command due to illness and sent to the hospital. On 19 January, he was awarded the Order of Suvorov2nd class. After recovery in March, Petrakovsky was put in reserve. In May 1944, he was sent to study at the Military Academy of the General Staff. After graduating in June 1945, he became 16th Army deputy commander. Petrakovsky participated in the Invasion of South Sakhalin in August 1945. On 27 August 1945, he was awarded the Order of Kutuzov 2nd class for his leadership during the invasion.
Postwar
At the end of 1945, Petrakovsky became the head of the department of Infantry Division commanders refresher courses at Frunze Military Academy. In April 1949, he became the head of the Military Directorate of the Soviet Military Administration in Germany. In March 1950, Petrakovsky became head of the People's Control Commission Military Directorate. In January 1951, he became the head of combat and physical training for the Odessa Military District. In May 1952, Petrakovsky became the head of the military department of the Sverdlovsk Law Institute. Petrakovsky retired from the army in November 1956.